/* Generated by Cython 3.2.8 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "asyncpg/pgproto/debug.h"
        ],
        "extra_compile_args": [
            "-O2",
            "-fsigned-char",
            "-Wall",
            "-Wsign-compare",
            "-Wconversion"
        ],
        "include_dirs": [
            "asyncpg/pgproto",
            "asyncpg/pgproto/"
        ],
        "name": "asyncpg.protocol.protocol",
        "sources": [
            "asyncpg/protocol/protocol.pyx"
        ]
    },
    "module_name": "asyncpg.protocol.protocol"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#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 < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_8"
#define CYTHON_HEX_VERSION 0x030208F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__asyncpg__protocol__protocol
#define __PYX_HAVE_API__asyncpg__protocol__protocol
/* Early includes */
#include <stdint.h>
#include "debug.h"
#include <string.h>
#include <stdio.h>

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE PyObject *
    __Pyx_CAPI_PyList_GetItemRef(PyObject *list, Py_ssize_t index)
    {
        PyObject *item = PyList_GetItem(list, index);
        Py_XINCREF(item);
        return item;
    }
    #else
    #define __Pyx_CAPI_PyList_GetItemRef PyList_GetItemRef
    #endif

    #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Extend(PyObject *list, PyObject *iterable)
    {
        return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable);
    }

    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Clear(PyObject *list)
    {
        return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
    }
    #else
    #define __Pyx_CAPI_PyList_Extend PyList_Extend
    #define __Pyx_CAPI_PyList_Clear PyList_Clear
    #endif
    

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    
#include <stddef.h>

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result)
    {
        int res;
        PyObject *key_obj = PyUnicode_FromString(key);
        if (key_obj == NULL) {
            *result = NULL;
            return -1;
        }
        res = __Pyx_PyDict_GetItemRef(mp, key_obj, result);
        Py_DECREF(key_obj);
        return res;
    }
    #else
    #define __Pyx_CAPI_PyDict_GetItemStringRef PyDict_GetItemStringRef
    #endif
    #if PY_VERSION_HEX < 0x030d0000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030F0000)
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value,
                        PyObject **result)
    {
        PyObject *value;
        if (__Pyx_PyDict_GetItemRef(d, key, &value) < 0) {
            // get error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (value != NULL) {
            // present
            if (result) {
                *result = value;
            }
            else {
                Py_DECREF(value);
            }
            return 1;
        }

        // missing: set the item
        if (PyDict_SetItem(d, key, default_value) < 0) {
            // set error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (result) {
            Py_INCREF(default_value);
            *result = default_value;
        }
        return 0;
    }
    #else
    #define __Pyx_CAPI_PyDict_SetDefaultRef PyDict_SetDefaultRef
    #endif
    

    #if PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
    {
        PyObject *obj = PyWeakref_GetObject(ref);
        if (obj == NULL) {
            // SystemError if ref is NULL
            *pobj = NULL;
            return -1;
        }
        if (obj == Py_None) {
            *pobj = NULL;
            return 0;
        }
        Py_INCREF(obj);
        *pobj = obj;
        return 1;
    }
    #else
    #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef
    #endif
    
#include "pythread.h"

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#include "record/recordobj.h"
#include "./hton.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "asyncpg/protocol/protocol.pyx",
  "asyncpg/protocol/codecs/base.pyx",
  "asyncpg/protocol/codecs/array.pyx",
  "asyncpg/protocol/scram.pyx",
  "cpython/contextvars.pxd",
  "asyncpg/pgproto/frb.pxd",
  "asyncpg/pgproto/buffer.pxd",
  "asyncpg/protocol/encodings.pyx",
  "asyncpg/protocol/settings.pyx",
  "(tree fragment)",
  "asyncpg/protocol/codecs/textutils.pyx",
  "asyncpg/protocol/codecs/pgproto.pyx",
  "asyncpg/protocol/codecs/range.pyx",
  "asyncpg/protocol/codecs/record.pyx",
  "asyncpg/protocol/scram.pxd",
  "asyncpg/protocol/coreproto.pyx",
  "asyncpg/protocol/coreproto.pxd",
  "asyncpg/protocol/prepared_stmt.pyx",
  "asyncpg/protocol/prepared_stmt.pxd",
  "asyncpg/protocol/protocol.pxd",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
  "asyncpg/protocol/pgtypes.pxi",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer;
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer;
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext;
struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap;
struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec;
struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig;
struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings;
struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol;
struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState;
struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close;
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};
struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer;
struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages;

/* "asyncpg/pgproto/frb.pxd":10
 * cdef:
 * 
 *     struct FRBuffer:             # <<<<<<<<<<<<<<
 *         const char* buf
 *         ssize_t len
*/
struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer {
  char const *buf;
  Py_ssize_t len;
};

/* "asyncpg/pgproto/buffer.pxd":69
 * 
 * 
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)             # <<<<<<<<<<<<<<
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1
*/
typedef char const *(*__pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method)(PyObject *, Py_ssize_t *);

/* "asyncpg/pgproto/buffer.pxd":70
 * 
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1             # <<<<<<<<<<<<<<
 * ctypedef int32_t (*take_message_method)(object) except -1
 * ctypedef char (*get_message_type_method)(object)
*/
typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method)(PyObject *, char);

/* "asyncpg/pgproto/buffer.pxd":71
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1             # <<<<<<<<<<<<<<
 * ctypedef char (*get_message_type_method)(object)
 * 
*/
typedef int32_t (*__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method)(PyObject *);

/* "asyncpg/pgproto/buffer.pxd":72
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1
 * ctypedef char (*get_message_type_method)(object)             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef char (*__pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method)(PyObject *);

/* "asyncpg/pgproto/buffer.pxd":137
 *     cdef bytes consume_message(self)
 *     cdef discard_message(self)
 *     cdef int32_t redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=?)             # <<<<<<<<<<<<<<
 *     cdef bytearray consume_messages(self, char mtype)
 *     cdef finish_message(self)
*/
struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages {
  int __pyx_n;
  int stop_at;
};

/* "asyncpg/pgproto/codecs/__init__.pxd":18
 * 
 * 
 * ctypedef object (*encode_func)(CodecContext settings,             # <<<<<<<<<<<<<<
 *                                WriteBuffer buf,
 *                                object obj)
*/
typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_encode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);

/* "asyncpg/pgproto/codecs/__init__.pxd":22
 *                                object obj)
 * 
 * ctypedef object (*decode_func)(CodecContext settings,             # <<<<<<<<<<<<<<
 *                                FRBuffer *buf)
 * 
*/
typedef PyObject *(*__pyx_t_7asyncpg_7pgproto_7pgproto_decode_func)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec;
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec;

/* "asyncpg/protocol/codecs/base.pxd":37
 * 
 * 
 * cdef enum CodecType:             # <<<<<<<<<<<<<<
 *     CODEC_UNDEFINED  = 0
 *     CODEC_C          = 1
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType {
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED = 0,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY = 3,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE = 4,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE = 5,
  __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE = 6
};

/* "asyncpg/protocol/codecs/base.pxd":47
 * 
 * 
 * cdef enum ServerDataFormat:             # <<<<<<<<<<<<<<
 *     PG_FORMAT_ANY = -1
 *     PG_FORMAT_TEXT = 0
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat {
  __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY = -1L,
  __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT = 0,
  __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY = 1
};

/* "asyncpg/protocol/codecs/base.pxd":53
 * 
 * 
 * cdef enum ClientExchangeFormat:             # <<<<<<<<<<<<<<
 *     PG_XFORMAT_OBJECT = 1
 *     PG_XFORMAT_TUPLE = 2
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat {
  __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE = 2
};

/* "asyncpg/protocol/coreproto.pxd":11
 * 
 * 
 * cdef enum ConnectionStatus:             # <<<<<<<<<<<<<<
 *     CONNECTION_OK = 1
 *     CONNECTION_BAD = 2
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus {
  __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_STARTED = 3
};

/* "asyncpg/protocol/coreproto.pxd":17
 * 
 * 
 * cdef enum ProtocolState:             # <<<<<<<<<<<<<<
 *     PROTOCOL_IDLE = 0
 * 
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState {
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE = 0,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED = 3,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING = 4,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH = 10,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE = 11,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE = 12,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY = 13,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL = 14,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY = 15,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE = 16,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND = 17,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT = 18,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA = 19,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE = 20,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN = 21,
  __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA = 22
};

/* "asyncpg/protocol/coreproto.pxd":40
 * 
 * 
 * cdef enum AuthenticationMessage:             # <<<<<<<<<<<<<<
 *     AUTH_SUCCESSFUL = 0
 *     AUTH_REQUIRED_KERBEROS = 2
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage {
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SUCCESSFUL = 0,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD = 3,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5 = 5,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SCMCRED = 6,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS = 7,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE = 8,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI = 9,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL = 10,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE = 11,
  __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL = 12
};

/* "asyncpg/protocol/coreproto.pxd":54
 * 
 * 
 * cdef enum ResultType:             # <<<<<<<<<<<<<<
 *     RESULT_OK = 1
 *     RESULT_FAILED = 2
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType {
  __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED = 2
};

/* "asyncpg/protocol/coreproto.pxd":59
 * 
 * 
 * cdef enum TransactionStatus:             # <<<<<<<<<<<<<<
 *     PQTRANS_IDLE = 0                 # connection idle
 *     PQTRANS_ACTIVE = 1               # command in progress
*/
enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus {
  __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE = 0,
  __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_ACTIVE = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR = 3,
  __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_UNKNOWN = 4
};

/* "asyncpg/protocol/codecs/base.pxd":8
 * 
 * 
 * ctypedef object (*encode_func)(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                                WriteBuffer buf,
 *                                object obj)
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);

/* "asyncpg/protocol/codecs/base.pxd":12
 *                                object obj)
 * 
 * ctypedef object (*decode_func)(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                                FRBuffer *buf)
 * 
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);

/* "asyncpg/protocol/codecs/base.pxd":15
 *                                FRBuffer *buf)
 * 
 * ctypedef object (*codec_encode_func)(Codec codec,             # <<<<<<<<<<<<<<
 *                                      ConnectionSettings settings,
 *                                      WriteBuffer buf,
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);

/* "asyncpg/protocol/codecs/base.pxd":20
 *                                      object obj)
 * 
 * ctypedef object (*codec_decode_func)(Codec codec,             # <<<<<<<<<<<<<<
 *                                      ConnectionSettings settings,
 *                                      FRBuffer *buf)
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);

/* "asyncpg/protocol/codecs/base.pxd":196
 *         dict _custom_type_codecs
 * 
 *     cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format,             # <<<<<<<<<<<<<<
 *                                 bint ignore_custom_codec=*)
 *     cdef inline Codec get_custom_codec(self, uint32_t oid,
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec {
  int __pyx_n;
  int ignore_custom_codec;
};

/* "asyncpg/protocol/settings.pxd":28
 *     cpdef inline set_builtin_type_codec(
 *         self, typeoid, typename, typeschema, typekind, alias_to, format)
 *     cpdef inline Codec get_data_codec(             # <<<<<<<<<<<<<<
 *         self, uint32_t oid, ServerDataFormat format=*,
 *         bint ignore_custom_codec=*)
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec {
  int __pyx_n;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat format;
  int ignore_custom_codec;
};

/* "asyncpg/protocol/coreproto.pxd":67
 * 
 * 
 * ctypedef object (*decode_row_method)(object, const char*, ssize_t)             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_row_method)(PyObject *, char const *, Py_ssize_t);

/* "asyncpg/protocol/coreproto.pxd":175
 *     cdef bint _bind_execute_many(self, str portal_name, str stmt_name,
 *                                  object bind_data, bint return_rows)
 *     cdef bint _bind_execute_many_more(self, bint first=*)             # <<<<<<<<<<<<<<
 *     cdef _bind_execute_many_fail(self, object error, bint first=*)
 *     cdef _bind(self, str portal_name, str stmt_name,
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more {
  int __pyx_n;
  int first;
};

/* "asyncpg/protocol/coreproto.pxd":176
 *                                  object bind_data, bint return_rows)
 *     cdef bint _bind_execute_many_more(self, bint first=*)
 *     cdef _bind_execute_many_fail(self, object error, bint first=*)             # <<<<<<<<<<<<<<
 *     cdef _bind(self, str portal_name, str stmt_name,
 *                WriteBuffer bind_data)
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail {
  int __pyx_n;
  int first;
};

/* "asyncpg/protocol/prepared_stmt.pxd":33
 *         tuple        rows_codecs
 * 
 *     cdef _encode_bind_msg(self, args, int seqno = ?)             # <<<<<<<<<<<<<<
 *     cpdef _init_codecs(self)
 *     cdef _ensure_rows_decoder(self)
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg {
  int __pyx_n;
  int seqno;
};

/* "asyncpg/protocol/codecs/array.pyx":669
 * 
 * 
 * cdef enum _ArrayParseState:             # <<<<<<<<<<<<<<
 *     APS_START = 1
 *     APS_STRIDE_STARTED = 2
*/
enum __pyx_t_7asyncpg_8protocol_8protocol__ArrayParseState {
  __pyx_e_7asyncpg_8protocol_8protocol_APS_START = 1,
  __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED = 2,
  __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE = 3,
  __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED = 4,
  __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED = 5,
  __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED = 6
};

/* "asyncpg/protocol/codecs/range.pyx":20
 * 
 * 
 * cdef enum _RangeArgumentType:             # <<<<<<<<<<<<<<
 *     _RANGE_ARGUMENT_INVALID = 0
 *     _RANGE_ARGUMENT_TUPLE = 1
*/
enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType {
  __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID = 0,
  __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE = 1,
  __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_RANGE = 2
};

/* "asyncpg/protocol/codecs/base.pyx":829
 * 
 * 
 * cdef inline Codec get_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec {
  int __pyx_n;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat;
};

/* "asyncpg/protocol/codecs/base.pyx":848
 * 
 * 
 * cdef inline Codec get_any_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec {
  int __pyx_n;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat;
};

/* "asyncpg/protocol/codecs/base.pyx":872
 * 
 * 
 * cdef register_core_codec(uint32_t oid,             # <<<<<<<<<<<<<<
 *                          encode_func encode,
 *                          decode_func decode,
*/
struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec {
  int __pyx_n;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat;
};

/* "asyncpg/protocol/codecs/array.pyx":21
 * 
 * 
 * ctypedef object (*encode_func_ex)(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                                   WriteBuffer buf,
 *                                   object obj,
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *);

/* "asyncpg/protocol/codecs/array.pyx":27
 * 
 * 
 * ctypedef object (*decode_func_ex)(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                                   FRBuffer *buf,
 *                                   const void *arg)
*/
typedef PyObject *(*__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *);

/* "asyncpg/pgproto/buffer.pxd":15
 * 
 * 
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Preallocated small buffer
*/
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtab;
  int _smallbuf_inuse;
  char _smallbuf[1024];
  char *_buf;
  Py_ssize_t _size;
  Py_ssize_t _length;
  int _view_count;
  int _message_mode;
};


/* "asyncpg/pgproto/buffer.pxd":75
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # A deque of buffers (bytes objects)
*/
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtab;
  PyObject *_bufs;
  PyObject *_bufs_append;
  PyObject *_bufs_popleft;
  PyObject *_buf0;
  PyObject *_buf0_prev;
  int32_t _bufs_len;
  Py_ssize_t _pos0;
  Py_ssize_t _len0;
  Py_ssize_t _length;
  char _current_message_type;
  int32_t _current_message_len;
  Py_ssize_t _current_message_len_unread;
  int _current_message_ready;
};


/* "asyncpg/pgproto/codecs/__init__.pxd":8
 * 
 * 
 * cdef class CodecContext:             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self)
*/
struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtab;
};


/* "asyncpg/protocol/codecs/base.pxd":25
 * 
 * 
 * cdef class CodecMap:             # <<<<<<<<<<<<<<
 *     cdef:
 *         void** binary_codec_map
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap *__pyx_vtab;
  void **binary_codec_map;
  void **text_codec_map;
  PyObject *extra_codecs;
};


/* "asyncpg/protocol/codecs/base.pxd":58
 * 
 * 
 * cdef class Codec:             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t        oid
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec *__pyx_vtab;
  uint32_t oid;
  PyObject *name;
  PyObject *schema;
  PyObject *kind;
  enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType type;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat format;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat xformat;
  __pyx_t_7asyncpg_8protocol_8protocol_encode_func c_encoder;
  __pyx_t_7asyncpg_8protocol_8protocol_decode_func c_decoder;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *base_codec;
  PyObject *py_encoder;
  PyObject *py_decoder;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *element_codec;
  Py_UCS4 element_delimiter;
  PyObject *element_type_oids;
  PyObject *element_names;
  PyObject *record_desc;
  PyObject *element_codecs;
  __pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func encoder;
  __pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func decoder;
};


/* "asyncpg/protocol/codecs/base.pxd":191
 * 
 * 
 * cdef class DataCodecConfig:             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict _derived_type_codecs
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_vtab;
  PyObject *_derived_type_codecs;
  PyObject *_custom_type_codecs;
};


/* "asyncpg/protocol/settings.pxd":8
 * 
 * 
 * cdef class ConnectionSettings(pgproto.CodecContext):             # <<<<<<<<<<<<<<
 *     cdef:
 *         str _encoding
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_base;
  PyObject *_encoding;
  PyObject *_codec;
  PyObject *_settings;
  int _is_utf8;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *_data_codecs;
};


/* "asyncpg/protocol/scram.pxd":8
 * 
 * 
 * cdef class SCRAMAuthentication:             # <<<<<<<<<<<<<<
 *     cdef:
 *         readonly bytes authentication_method
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_vtab;
  PyObject *authentication_method;
  PyObject *authorization_message;
  PyObject *client_channel_binding;
  PyObject *client_first_message_bare;
  PyObject *client_nonce;
  PyObject *client_proof;
  PyObject *password_salt;
  int password_iterations;
  PyObject *server_first_message;
  PyObject *server_key;
  PyObject *server_nonce;
};


/* "asyncpg/protocol/coreproto.pxd":70
 * 
 * 
 * cdef class CoreProtocol:             # <<<<<<<<<<<<<<
 *     cdef:
 *         ReadBuffer buffer
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_vtab;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *buffer;
  int _skip_discard;
  int _discard_data;
  PyObject *_execute_iter;
  PyObject *_execute_portal_name;
  PyObject *_execute_stmt_name;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus con_status;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState state;
  enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus xact_status;
  PyObject *encoding;
  PyObject *transport;
  PyObject *address;
  PyObject *con_params;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *scram;
  PyObject *gss_ctx;
  int32_t backend_pid;
  int32_t backend_secret;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType result_type;
  PyObject *result;
  PyObject *result_param_desc;
  PyObject *result_row_desc;
  PyObject *result_status_msg;
  int result_execute_completed;
};


/* "asyncpg/protocol/prepared_stmt.pxd":8
 * 
 * 
 * cdef class PreparedStatementState:             # <<<<<<<<<<<<<<
 *     cdef:
 *         readonly str name
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState {
  PyObject_HEAD
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_vtab;
  PyObject *name;
  PyObject *query;
  int closed;
  int prepared;
  int refs;
  PyTypeObject *record_class;
  int ignore_custom_codec;
  PyObject *row_desc;
  PyObject *parameters_desc;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *settings;
  int16_t args_num;
  int have_text_args;
  PyObject *args_codecs;
  int16_t cols_num;
  PyObject *cols_desc;
  int have_text_cols;
  PyObject *rows_codecs;
};


/* "asyncpg/protocol/protocol.pxd":30
 * 
 * 
 * cdef class BaseProtocol(CoreProtocol):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_base;
  PyObject *loop;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *settings;
  PyObject *cancel_sent_waiter;
  PyObject *cancel_waiter;
  PyObject *waiter;
  int return_extra;
  PyObject *create_future;
  PyObject *timeout_handle;
  PyObject *conref;
  PyTypeObject *record_class;
  int is_reading;
  PyObject *last_query;
  int writing_paused;
  int closing;
  uint64_t queries_count;
  int _is_ssl;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *statement;
};


/* "asyncpg/protocol/scram.pyx":188
 *     cdef _bytes_xor(self, bytes a, bytes b):
 *         """XOR two bytestrings together"""
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))             # <<<<<<<<<<<<<<
 * 
 *     cdef _generate_client_nonce(self, int num_bytes):
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_a_i;
  PyObject *__pyx_v_b_i;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "asyncpg/protocol/scram.pyx":256
 *         return u
 * 
 *     cdef _normalize_password(self, str original_password):             # <<<<<<<<<<<<<<
 *         """Normalize the password using the SASLprep from RFC4013"""
 *         cdef:
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password {
  PyObject_HEAD
  PyObject *__pyx_v_c;
};


/* "asyncpg/protocol/scram.pyx":287
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c             # <<<<<<<<<<<<<<
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
 *         )
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
};


/* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_in_prohibited_table;
};


/* "asyncpg/protocol/scram.pyx":327
 *         #    character must be the first and last character of the string
 *         # RandALCat characters are found in table D.1, whereas LCat are in D.2
 *         if any(stringprep.in_table_d1(c) for c in normalized_password_tuple):             # <<<<<<<<<<<<<<
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
};


/* "asyncpg/protocol/scram.pyx":336
 *             # if any characters are in D.2, use the original password
 *             if any(
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_c;
};


/* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_ignore_custom_codec;
  PyObject *__pyx_v_query;
  PyObject *__pyx_v_record_class;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_stmt_name;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":167
 *             return await waiter
 * 
 *     async def bind_execute(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_args_buf;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_limit;
  PyObject *__pyx_v_portal_name;
  int __pyx_v_return_extra;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":207
 *             return await waiter
 * 
 *     async def bind_execute_many(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many {
  PyObject_HEAD
  PyObject *__pyx_v_arg_bufs;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_data_gen;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_genexpr;
  int __pyx_v_more;
  PyObject *__pyx_v_portal_name;
  int __pyx_v_return_rows;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_timer;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
  PyObject *__pyx_t_6;
};


/* "asyncpg/protocol/protocol.pyx":228
 *         # this generator expression to keep the memory pressure under
 *         # control.
 *         data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args))             # <<<<<<<<<<<<<<
 *         arg_bufs = iter(data_gen)
 * 
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_b;
  PyObject *__pyx_v_i;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
};


/* "asyncpg/protocol/protocol.pyx":268
 *             return await waiter
 * 
 *     async def bind(self, PreparedStatementState state, args,             # <<<<<<<<<<<<<<
 *                    str portal_name, timeout):
 * 
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_args_buf;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_portal_name;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":296
 *             return await waiter
 * 
 *     async def execute(self, PreparedStatementState state,             # <<<<<<<<<<<<<<
 *                       str portal_name, int limit, return_extra,
 *                       timeout):
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  int __pyx_v_limit;
  PyObject *__pyx_v_portal_name;
  PyObject *__pyx_v_return_extra;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":325
 *             return await waiter
 * 
 *     async def close_portal(self, str portal_name, timeout):             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_portal_name;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":347
 *             return await waiter
 * 
 *     async def query(self, query, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_query;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":371
 *             return await waiter
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out {
  PyObject_HEAD
  PyObject *__pyx_v_buffer;
  PyObject *__pyx_v_copy_stmt;
  PyObject *__pyx_v_done;
  PyObject *__pyx_v_ex;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  PyObject *__pyx_v_sink;
  PyObject *__pyx_v_status_msg;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_timer;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
  PyObject *__pyx_t_6;
};


/* "asyncpg/protocol/protocol.pyx":424
 *         return status_msg
 * 
 *     async def copy_in(self, copy_stmt, reader, data,             # <<<<<<<<<<<<<<
 *                       records, PreparedStatementState record_stmt, timeout):
 *         cdef:
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in {
  PyObject_HEAD
  PyObject *__pyx_v_aiter;
  PyObject *__pyx_v_chunk;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec;
  PyObject *__pyx_v_codecs;
  PyObject *__pyx_v_copy_stmt;
  PyObject *__pyx_v_data;
  PyObject *__pyx_v_e;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item;
  PyObject *__pyx_v_iterator;
  Py_ssize_t __pyx_v_num_cols;
  PyObject *__pyx_v_reader;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt;
  PyObject *__pyx_v_records;
  PyObject *__pyx_v_row;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings;
  PyObject *__pyx_v_status_msg;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_timer;
  PyObject *__pyx_v_waiter;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_wbuf;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
  PyObject *__pyx_t_6;
  PyObject *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10;
  PyObject *__pyx_t_11;
};


/* "asyncpg/protocol/protocol.pyx":562
 *         return status_msg
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement {
  PyObject_HEAD
  PyObject *__pyx_v_ex;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_v_waiter;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4;
  PyObject *__pyx_t_5;
};


/* "asyncpg/protocol/protocol.pyx":602
 *         self.transport = None
 * 
 *     async def close(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close {
  PyObject_HEAD
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
  PyObject *__pyx_v_timeout;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
};


/* "asyncpg/protocol/protocol.pyx":744
 *         )
 * 
 *     async def _wait_for_cancellation(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation {
  PyObject_HEAD
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self;
};



/* "asyncpg/pgproto/buffer.pxd":15
 * 
 * 
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Preallocated small buffer
*/

struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer {
  PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*_check_readonly)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*_ensure_alloced)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t);
  PyObject *(*_reallocate)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t);
  PyObject *(*reset)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*start_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char);
  PyObject *(*end_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char);
  PyObject *(*write_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_len_prefixed_buffer)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_bytestring)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *);
  PyObject *(*write_frbuf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*write_cstr)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t);
  PyObject *(*write_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int16_t);
  PyObject *(*write_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t);
  PyObject *(*write_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int64_t);
  PyObject *(*write_float)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, float);
  PyObject *(*write_double)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, double);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*new_message)(char);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*__pyx_new)(void);
};
static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer;
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);


/* "asyncpg/pgproto/buffer.pxd":75
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # A deque of buffers (bytes objects)
*/

struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer {
  PyObject *(*len)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  char (*get_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*get_message_length)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*feed_data)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, PyObject *);
  PyObject *(*_ensure_first_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*_switch_to_next_buf)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  char (*read_byte)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  char const *(*_try_read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*_read_into)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t);
  PyObject *(*_read_and_discard)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*read_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*read_len_prefixed_bytes)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_len_prefixed_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_uuid)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int64_t (*read_int64)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*read_int32)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int16_t (*read_int16)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_null_str)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*take_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*take_message_type)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char);
  int32_t (*put_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  char const *(*try_consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *);
  PyObject *(*consume_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*discard_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*redirect_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_7asyncpg_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args);
  PyObject *(*consume_messages)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *, char);
  PyObject *(*finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*_finish_message)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *(*new_message_parser)(PyObject *);
};
static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer;
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);
static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *);


/* "asyncpg/pgproto/codecs/__init__.pxd":8
 * 
 * 
 * cdef class CodecContext:             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self)
*/

struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext {
  PyObject *(*get_text_codec)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_encoding_utf8)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *);
  PyObject *(*get_json_decoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_decoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *);
  PyObject *(*get_json_encoder)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_encoding_json)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *);
};
static struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext;


/* "asyncpg/protocol/codecs/base.pyx":17
 * # does not (as of 3.1.0) store global cdef variables
 * # in module state.
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class CodecMap:
 * 
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap {
  void *(*get_binary_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t);
  void (*set_binary_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *);
  void *(*get_text_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t);
  void (*set_text_codec_ptr)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap;
static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t);
static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *);
static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t);
static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *);


/* "asyncpg/protocol/codecs/base.pyx":43
 * 
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class Codec:
 * 
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec {
  PyObject *(*init)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4);
  PyObject *(*encode_scalar)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_multirange)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*encode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*decode_scalar)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_array)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_array_text)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_range)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_multirange)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_composite)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*decode_in_python)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*encode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*decode)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*has_encoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  PyObject *(*has_decoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  PyObject *(*is_binary)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*copy)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_array_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_range_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_multirange_codec)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_composite_codec)(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*new_python_codec)(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec *__pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4);
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *);
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *);
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat);


/* "asyncpg/protocol/codecs/base.pyx":509
 * 
 * 
 * cdef class DataCodecConfig:             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         # Codec instance cache for derived types:
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_custom_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig;
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args);
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat);


/* "asyncpg/protocol/settings.pyx":11
 * 
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class ConnectionSettings(pgproto.CodecContext):
 * 
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings {
  struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext __pyx_base;
  PyObject *(*add_setting)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *);
  PyObject *(*register_data_types)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*add_python_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*remove_python_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*clear_type_cache)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch);
  PyObject *(*set_builtin_type_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*get_data_codec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args);


/* "asyncpg/protocol/scram.pyx":17
 * 
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class SCRAMAuthentication:
 *     """Contains the protocol for generating and a SCRAM hashed password.
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication {
  PyObject *(*create_client_first_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
  PyObject *(*create_client_final_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
  PyObject *(*parse_server_first_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
  PyObject *(*verify_server_final_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
  PyObject *(*_bytes_xor)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *);
  PyObject *(*_generate_client_nonce)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int);
  PyObject *(*_generate_client_proof)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
  PyObject *(*_generate_salted_password)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int);
  PyObject *(*_normalize_password)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *);


/* "asyncpg/protocol/coreproto.pyx":24
 * 
 * 
 * cdef class CoreProtocol:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, addr, con_params):
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol {
  PyObject *(*is_in_transaction)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int __pyx_skip_dispatch);
  PyObject *(*_process__auth)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__prepare)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__bind_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__bind_execute_many)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__close_stmt_portal)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__copy_out_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_process__copy_in_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char);
  PyObject *(*_parse_msg_authentication)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_msg_parameter_status)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_msg_notification)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_msg_backend_key_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_msg_ready_for_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_data_msgs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_copy_data_msgs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_parse_msg_error_response)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_parse_msg_command_complete)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_write_copy_data_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_write_copy_done_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_write_copy_fail_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_auth_password_message_cleartext)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_auth_password_message_md5)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_auth_password_message_sasl_initial)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_auth_password_message_sasl_continue)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_auth_gss_init_gssapi)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_auth_gss_init_sspi)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int);
  PyObject *(*_auth_gss_get_service)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_auth_gss_step)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_write)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_writelines)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_read_server_messages)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_push_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_reset_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_set_state)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState);
  PyObject *(*_ensure_connected)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_parse_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_bind_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_empty_bind_data)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*_build_execute_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t);
  PyObject *(*_connect)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_prepare_and_describe)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *);
  PyObject *(*_send_parse_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *);
  PyObject *(*_send_bind_message)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t);
  PyObject *(*_bind_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t);
  int (*_bind_execute_many)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *, int);
  int (*_bind_execute_many_more)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args);
  PyObject *(*_bind_execute_many_fail)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args);
  PyObject *(*_bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*_execute)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t);
  PyObject *(*_close)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int);
  PyObject *(*_simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_terminate)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_decode_row)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t);
  PyObject *(*_on_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *);
  PyObject *(*_on_notification)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *);
  PyObject *(*_on_notice)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
  PyObject *(*_set_server_parameter)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *);
  PyObject *(*_on_connection_lost)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol;


/* "asyncpg/protocol/prepared_stmt.pyx":11
 * 
 * 
 * @cython.final             # <<<<<<<<<<<<<<
 * cdef class PreparedStatementState:
 * 
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState {
  PyObject *(*_encode_bind_msg)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args);
  PyObject *(*_init_codecs)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch);
  PyObject *(*_ensure_rows_decoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *);
  PyObject *(*_ensure_args_encoder)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *);
  PyObject *(*_set_row_desc)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *);
  PyObject *(*_set_args_desc)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *);
  PyObject *(*_decode_row)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *);
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t);


/* "asyncpg/protocol/protocol.pyx":76
 * 
 * 
 * cdef class BaseProtocol(CoreProtocol):             # <<<<<<<<<<<<<<
 *     def __init__(self, addr, connected_fut, con_params, record_class: type, loop):
 *         # type of `con_params` is `_ConnectionParameters`
*/

struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol {
  struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_base;
  PyObject *(*get_connection)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
  PyObject *(*_get_timeout_impl)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_check_state)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
  PyObject *(*_new_waiter)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_coreproto_error)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
  PyObject *(*_on_result__connect)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__prepare)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__bind_and_exec)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__close_stmt_or_portal)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__simple_query)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__bind)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__copy_out)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_on_result__copy_in)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_handle_waiter_on_connection_lost)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
  PyObject *(*_dispatch_result)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
  PyObject *(*resume_reading)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
  PyObject *(*pause_reading)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
};
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *);
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #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); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

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

/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

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

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

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

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

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

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

/* PyObjectCall.proto (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

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

/* PyObjectFastCall.proto (used by PyObjectFastCallMethod) */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* TupleAndListFromArray.proto (used by fastcall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

/* BytesEquals.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

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

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

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

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by RejectKeywords) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

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

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

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

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

/* GetTopmostException.proto (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

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

/* PyKeyError_Check.proto */
#define __Pyx_PyExc_KeyError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_KeyError)

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

/* PyAttributeError_Check.proto */
#define __Pyx_PyExc_AttributeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AttributeError)

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

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

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

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

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

/* PyOverflowError_Check.proto */
#define __Pyx_PyExc_OverflowError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_OverflowError)

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

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

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

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* py_dict_pop_ignore.proto */
static CYTHON_INLINE int __Pyx_PyDict_Pop_ignore(PyObject *d, PyObject *key, PyObject *default_value);

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

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

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_uint32_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_uint32_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char, char format_char);

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* PyObjectCall2Args.proto (used by CallUnboundCMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

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

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

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

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_long(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_long(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_long(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

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

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

/* PyIndexError_Check.proto */
#define __Pyx_PyExc_IndexError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_IndexError)

/* bytes_tailmatch.proto */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction);
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction);

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

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

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

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

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

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

/* PyUnicodeEncodeError_Check.proto */
#define __Pyx_PyExc_UnicodeEncodeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_UnicodeEncodeError)

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

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

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char, char format_char);

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

/* PyModuleNotFoundError_Check.proto */
#define __Pyx_PyExc_ModuleNotFoundError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ModuleNotFoundError)

/* decode_c_string_utf16.proto (used by decode_c_bytes) */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_bytes.proto (used by decode_bytes) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyBytes_AS_STRING(string);
    size = PyBytes_GET_SIZE(string);
#else
    if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) {
        return NULL;
    }
#endif
    return __Pyx_decode_c_bytes(
        as_c_string, size,
        start, stop, encoding, errors, decode_func);
}

/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

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

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

/* UnpackTuple2.proto (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple);
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

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

/* IterNextPlain.proto (used by IterNext) */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

/* IterNext.proto */
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);

/* PyStopIteration_Check.proto */
#define __Pyx_PyExc_StopIteration_Check(obj)  __Pyx_TypeCheck(obj, PyExc_StopIteration)

/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_NotImplementedError)

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON
    #if CYTHON_REFNANNY
        #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny)
    #else
        #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared)
    #endif
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique)
    #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference)
    static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    );
#else
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right))
#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\
    ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right))

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* PyUnicode_Substring.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
            PyObject* text, Py_ssize_t start, Py_ssize_t stop);

/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);

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

/* PyBufferError_Check.proto */
#define __Pyx_PyExc_BufferError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_BufferError)

/* RaiseKeywordRequired.proto */
static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name);

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto (used by FetchCommonType) */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

/* FetchSharedCythonModule.proto (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CoroutineBase) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CallTypeTraverse.proto (used by CoroutineBase) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

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

/* ReturnWithStopIteration.proto (used by CoroutineBase) */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto (used by Coroutine) */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *gi_weakreflist;
#endif
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

/* Coroutine.proto (used by CoroutineYieldFrom) */
#define __Pyx_Coroutine_USED
#define __Pyx_Coroutine_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineType)
#define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj)
#define __Pyx_CoroutineAwait_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineAwaitType)
#define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_CoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_Coroutine_init(PyObject *module);
static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
typedef struct {
    PyObject_HEAD
    PyObject *coroutine;
} __pyx_CoroutineAwaitObject;
static __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self);

/* Coro_CheckExact.proto (used by GetAwaitIter) */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyCoro_CheckExact(PyObject *o);
#else
#define __Pyx_PyCoro_CheckExact PyCoro_CheckExact
#endif

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

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

/* pyint_simplify.proto */
static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto (used by CythonFunction) */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

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

/* AsyncIter.proto */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *o);
static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *o);

/* PyTimeoutError_Check.proto */
#define __Pyx_PyExc_TimeoutError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TimeoutError)

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_LIMITED_API  ||  PY_VERSION_HEX >= 0x030C0000
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  #if __clang__ || __GNUC__
  __attribute__((no_sanitize("thread")))
  #endif
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

/* PyConnectionResetError_Check.proto */
#define __Pyx_PyExc_ConnectionResetError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ConnectionResetError)

/* pybytes_as_double.proto (used by pynumber_float) */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length);
static CYTHON_INLINE double __Pyx_PyBytes_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyBytes_AS_STRING(obj);
    size = PyBytes_GET_SIZE(obj);
#else
    if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
        return (double)-1;
    }
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}
static CYTHON_INLINE double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    as_c_string = PyByteArray_AS_STRING(obj);
    size = PyByteArray_GET_SIZE(obj);
#else
    as_c_string = PyByteArray_AsString(obj);
    if (as_c_string == NULL) {
        return (double)-1;
    }
    size = PyByteArray_Size(obj);
#endif
    return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
}

/* pyunicode_as_double.proto (used by pynumber_float) */
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
static const char* __Pyx__PyUnicode_AsDouble_Copy(const void* data, const int kind, char* buffer, Py_ssize_t start, Py_ssize_t end) {
    int last_was_punctuation;
    Py_ssize_t i;
    last_was_punctuation = 1;
    for (i=start; i <= end; i++) {
        Py_UCS4 chr = PyUnicode_READ(kind, data, i);
        int is_punctuation = (chr == '_') | (chr == '.');
        *buffer = (char)chr;
        buffer += (chr != '_');
        if (unlikely(chr > 127)) goto parse_failure;
        if (unlikely(last_was_punctuation & is_punctuation)) goto parse_failure;
        last_was_punctuation = is_punctuation;
    }
    if (unlikely(last_was_punctuation)) goto parse_failure;
    *buffer = '\0';
    return buffer;
parse_failure:
    return NULL;
}
static double __Pyx__PyUnicode_AsDouble_inf_nan(const void* data, int kind, Py_ssize_t start, Py_ssize_t length) {
    int matches = 1;
    Py_UCS4 chr;
    Py_UCS4 sign = PyUnicode_READ(kind, data, start);
    int is_signed = (sign == '-') | (sign == '+');
    start += is_signed;
    length -= is_signed;
    switch (PyUnicode_READ(kind, data, start)) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'a') | (chr == 'A');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'n') | (chr == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+1);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+2);
            matches &= (chr == 'f') | (chr == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            chr = PyUnicode_READ(kind, data, start+3);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+4);
            matches &= (chr == 'n') | (chr == 'N');
            chr = PyUnicode_READ(kind, data, start+5);
            matches &= (chr == 'i') | (chr == 'I');
            chr = PyUnicode_READ(kind, data, start+6);
            matches &= (chr == 't') | (chr == 'T');
            chr = PyUnicode_READ(kind, data, start+7);
            matches &= (chr == 'y') | (chr == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
    double value;
    const char *last;
    char *end;
    Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
    const int kind = PyUnicode_KIND(obj);
    const void* data = PyUnicode_DATA(obj);
    start = 0;
    while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
        start++;
    while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
        length--;
    length -= start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    if (length < 40) {
        char number[40];
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((length + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyUnicode_AsDouble_Copy(data, kind, number, start, start + length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}
#endif
static CYTHON_INLINE double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
        return (double)-1;
    if (likely(PyUnicode_IS_ASCII(obj))) {
        const char *s;
        Py_ssize_t length;
        s = PyUnicode_AsUTF8AndSize(obj, &length);
        return __Pyx__PyBytes_AsDouble(obj, s, length);
    }
    return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
#else
    return __Pyx_SlowPyString_AsDouble(obj);
#endif
}

/* pynumber_float.proto */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* CallNextTpDealloc.proto */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear);

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

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

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_8
#define __PYX_HAVE_RT_ImportType_proto_3_2_8
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_8 {
   __Pyx_ImportType_CheckSize_Error_3_2_8 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_8 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_8 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size);
#endif

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_2_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

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

/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);

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

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

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

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyLong_As_int32_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *);

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value);

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value);

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *);

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ptrdiff_t(ptrdiff_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int16_t(int16_t value);

/* ObjectAsUCS4.proto */
static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject*);
static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject *x) {
    return (likely(PyUnicode_Check(x)) ? __Pyx_PyUnicode_AsPy_UCS4(x) : __Pyx__PyObject_AsPy_UCS4(x));
}

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
#endif
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args); /* proto*/
static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx); /* proto*/
static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr); /* proto*/
static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx); /* proto*/
static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType __pyx_v_type, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, PyObject *__pyx_v_py_encoder, PyObject *__pyx_v_py_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names, PyObject *__pyx_v_element_codecs, Py_UCS4 __pyx_v_element_delimiter); /* proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto*/
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, Py_UCS4 __pyx_v_element_delimiter); /* proto*/
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec); /* proto*/
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec); /* proto*/
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, PyObject *__pyx_v_element_codecs, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names); /* proto*/
static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat); /* proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args); /* proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_username); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_final_message); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, int __pyx_v_num_bytes); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password, PyObject *__pyx_v_salt, int __pyx_v_iterations); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_original_password); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_cause); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_salt); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_sasl_auth_methods); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_v_negotiate); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_is_error); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_new_state); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/
static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data); /* proto*/
static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit); /* proto*/
static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_bind_data, int __pyx_v_return_rows); /* proto*/
static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_error, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_v_is_portal); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_query); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buffers); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED Py_ssize_t __pyx_v_buf_len); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_val); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_parsed); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_channel, CYTHON_UNUSED PyObject *__pyx_v_payload); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_args, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, char const *__pyx_v_cbuf, Py_ssize_t __pyx_v_buf_len); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_get_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_cause); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, Py_ssize_t __pyx_v_buf_len); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_parsed); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_pid, PyObject *__pyx_v_channel, PyObject *__pyx_v_payload); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buffers); /* proto*/

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

/* Module declarations from "asyncpg.pgproto.debug" */

/* Module declarations from "cython" */

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

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

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

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

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "libc.stddef" */

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

/* Module declarations from "cpython.pyport" */

/* 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.set" */

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

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

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

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "cpython" */

/* Module declarations from "asyncpg.pgproto.pgproto" */
static CYTHON_INLINE Py_ssize_t __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, char const *, Py_ssize_t); /*proto*/
static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static CYTHON_INLINE struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check)(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/

/* Module declarations from "asyncpg.pgproto" */

/* Module declarations from "asyncpg.protocol" */

/* Module declarations from "asyncpg.protocol.cpythonx" */

/* Module declarations from "asyncpg.protocol.recordcapi" */

/* Module declarations from "asyncpg.pgproto.hton" */

/* Module declarations from "asyncpg.protocol.protocol" */
static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_k;
static PyObject *__pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_v;
static Py_UCS4 *__pyx_v_7asyncpg_8protocol_8protocol_APG_NULL;
static PyObject *__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k;
static PyObject *__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v;
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/
static uint32_t __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(PyObject *); /*proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec *__pyx_optional_args); /*proto*/
static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); /*proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat); /*proto*/
static CYTHON_INLINE uint32_t __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(uint32_t); /*proto*/
static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(Py_UCS4 const *, Py_UCS4 const *); /*proto*/
static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(char const *, char const *); /*proto*/
static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(Py_UCS4); /*proto*/
static Py_UCS4 *__pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(Py_UCS4 *, int32_t *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(void); /*proto*/
static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(PyObject *, int32_t *, int32_t *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_array_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int32_t, int32_t, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int32_t, int32_t, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *, Py_UCS4); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *, Py_UCS4); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, int32_t, int32_t *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, Py_UCS4); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, Py_UCS4 *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *, Py_UCS4); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(Py_UCS4 const *, Py_UCS4 const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(Py_UCS4 const *, Py_UCS4, int32_t *, int32_t *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(void); /*proto*/
static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(uint8_t); /*proto*/
static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(uint8_t); /*proto*/
static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_f_7asyncpg_8protocol_8protocol__range_type(PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *, uint32_t, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex, void const *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex, void const *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "asyncpg.protocol.protocol"
extern int __pyx_module_is_main_asyncpg__protocol__protocol;
int __pyx_module_is_main_asyncpg__protocol__protocol = 0;

/* Implementation of "asyncpg.protocol.protocol" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_reversed;
static PyObject *__pyx_builtin_any;
static PyObject *__pyx_builtin_zip;
/* #### Code section: string_decls ### */
static const char __pyx_k_NULL[] = "NULL";
static const char __pyx_k_custom_type_codecs__derived_typ[] = "_custom_type_codecs, _derived_type_codecs";
static const char __pyx_k_discard_data__execute_iter__exe[] = "_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status";
static const char __pyx_k_discard_data__execute_iter__exe_2[] = "_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status";
/* #### Code section: decls ### */
static int __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, int __pyx_v_ignore_custom_codec); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, uint32_t __pyx_v_oid); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, PyObject *__pyx_v_xformat); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, CYTHON_UNUSED PyObject *__pyx_v_typename, CYTHON_UNUSED PyObject *__pyx_v_typeschema); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_12clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_authentication_method); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_con_params); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol, PyTypeObject *__pyx_v_record_class, int __pyx_v_ignore_custom_codec); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_con_params, PyTypeObject *__pyx_v_record_class, PyObject *__pyx_v_loop); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_connection); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_4get_server_pid(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_ignore_custom_codec, PyObject *__pyx_v_record_class); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_limit, int __pyx_v_return_extra, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout, int __pyx_v_return_rows); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_portal_name, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_sink, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_reader, PyObject *__pyx_v_data, PyObject *__pyx_v_records, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_42is_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_55_create_future_fallback(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_59_is_cancelling(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_transport); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_76__setstate_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_budget); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_et, CYTHON_UNUSED PyObject *__pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_amount); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol__create_record(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_elems); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer;
  PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer;
  PyTypeObject *__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_CodecMap;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_Codec;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close;
  PyObject *__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_Codec;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close;
  PyTypeObject *__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_k_;
  PyObject *__pyx_k__4;
  PyObject *__pyx_k__5;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__7;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__8;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_k__9;
  PyObject *__pyx_slice[1];
  PyObject *__pyx_tuple[1];
  PyObject *__pyx_codeobj_tab[86];
  PyObject *__pyx_string_tab[937];
  PyObject *__pyx_number_tab[109];
/* #### Code section: module_state_contents ### */
/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* Coroutine.module_state_decls */
PyTypeObject *__pyx_CoroutineType;
PyTypeObject *__pyx_CoroutineAwaitType;

/* Coro_CheckExact.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedCoroType;
#endif

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[8];
int __pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* Generator.module_state_decls */
PyTypeObject *__pyx_GeneratorType;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_Bind_expected_a_sequence_got __pyx_string_tab[0]
#define __pyx_kp_u_Check_the_query_against_the_pass __pyx_string_tab[1]
#define __pyx_kp_u_Codec_oid_elem_oid_core __pyx_string_tab[2]
#define __pyx_kp_u_ConnectionSettings_r __pyx_string_tab[3]
#define __pyx_kp_u_Consider_declaring_an_explicit_c __pyx_string_tab[4]
#define __pyx_kp_u_GSSAPI_SSPI_authentication_is_on __pyx_string_tab[5]
#define __pyx_kp_u_None __pyx_string_tab[6]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[7]
#define __pyx_kp_u_Note_that_parameters_are_suppor __pyx_string_tab[8]
#define __pyx_kp_u_OID __pyx_string_tab[9]
#define __pyx_kp_u_OID_value_too_large_r __pyx_string_tab[10]
#define __pyx_kp_u_PostgreSQL_does_not_implement_an __pyx_string_tab[11]
#define __pyx_kp_u_TimoutError_was_not_raised __pyx_string_tab[12]
#define __pyx_kp_u__14 __pyx_string_tab[13]
#define __pyx_kp_u__15 __pyx_string_tab[14]
#define __pyx_kp_u__16 __pyx_string_tab[15]
#define __pyx_kp_u__17 __pyx_string_tab[16]
#define __pyx_kp_u__18 __pyx_string_tab[17]
#define __pyx_kp_u__19 __pyx_string_tab[18]
#define __pyx_kp_u__20 __pyx_string_tab[19]
#define __pyx_kp_u__21 __pyx_string_tab[20]
#define __pyx_kp_u__22 __pyx_string_tab[21]
#define __pyx_kp_u__23 __pyx_string_tab[22]
#define __pyx_kp_u__24 __pyx_string_tab[23]
#define __pyx_kp_u__25 __pyx_string_tab[24]
#define __pyx_kp_u__3 __pyx_string_tab[25]
#define __pyx_kp_u__6 __pyx_string_tab[26]
#define __pyx_kp_u_a_sized_iterable_container_expec __pyx_string_tab[27]
#define __pyx_kp_u_add_note __pyx_string_tab[28]
#define __pyx_kp_u_already_connected __pyx_string_tab[29]
#define __pyx_kp_u_array_length_overflow __pyx_string_tab[30]
#define __pyx_kp_u_asyncpg_Protocol_has_no_referenc __pyx_string_tab[31]
#define __pyx_kp_u_asyncpg_protocol_codecs_base_pyx __pyx_string_tab[32]
#define __pyx_kp_u_asyncpg_protocol_coreproto_pyx __pyx_string_tab[33]
#define __pyx_kp_u_asyncpg_protocol_prepared_stmt_p __pyx_string_tab[34]
#define __pyx_kp_u_asyncpg_protocol_protocol_pyx __pyx_string_tab[35]
#define __pyx_kp_u_asyncpg_protocol_scram_pyx __pyx_string_tab[36]
#define __pyx_kp_u_asyncpg_protocol_settings_pyx __pyx_string_tab[37]
#define __pyx_kp_u_base_codec_is_mutually_exclusive __pyx_string_tab[38]
#define __pyx_kp_u_bit_varying __pyx_string_tab[39]
#define __pyx_kp_u_bytes __pyx_string_tab[40]
#define __pyx_kp_u_cannot_alias __pyx_string_tab[41]
#define __pyx_kp_u_cannot_close_prepared_statement __pyx_string_tab[42]
#define __pyx_kp_u_cannot_decode_type_text_encoding __pyx_string_tab[43]
#define __pyx_kp_u_cannot_decode_type_text_encoding_2 __pyx_string_tab[44]
#define __pyx_kp_u_cannot_perform_operation_another __pyx_string_tab[45]
#define __pyx_kp_u_cannot_perform_operation_another_2 __pyx_string_tab[46]
#define __pyx_kp_u_cannot_perform_operation_connect __pyx_string_tab[47]
#define __pyx_kp_u_cannot_process_message __pyx_string_tab[48]
#define __pyx_kp_u_cannot_register_core_codec_for_O __pyx_string_tab[49]
#define __pyx_kp_u_cannot_switch_to_idle_state_prot __pyx_string_tab[50]
#define __pyx_kp_u_cannot_switch_to_state_another_o __pyx_string_tab[51]
#define __pyx_kp_u_cannot_switch_to_state_protocol __pyx_string_tab[52]
#define __pyx_kp_u_character_varying __pyx_string_tab[53]
#define __pyx_kp_u_codec_for __pyx_string_tab[54]
#define __pyx_kp_u_connection_was_closed_in_the_mid __pyx_string_tab[55]
#define __pyx_kp_u_could_not_get_iterations __pyx_string_tab[56]
#define __pyx_kp_u_could_not_get_nonce __pyx_string_tab[57]
#define __pyx_kp_u_could_not_get_salt __pyx_string_tab[58]
#define __pyx_kp_u_could_not_get_server_signature __pyx_string_tab[59]
#define __pyx_kp_u_could_not_verify_server_signatur __pyx_string_tab[60]
#define __pyx_kp_u_decode_row_statement_is_None __pyx_string_tab[61]
#define __pyx_kp_u_disable __pyx_string_tab[62]
#define __pyx_kp_u_double_precision __pyx_string_tab[63]
#define __pyx_kp_u_duplicate_GSSAPI_SSPI_authentica __pyx_string_tab[64]
#define __pyx_kp_u_enable __pyx_string_tab[65]
#define __pyx_kp_u_expected_0_1_or_2_elements_in_ra __pyx_string_tab[66]
#define __pyx_kp_u_expected_a_sequence_got __pyx_string_tab[67]
#define __pyx_kp_u_expected_a_sequence_got_type_r __pyx_string_tab[68]
#define __pyx_kp_u_gc __pyx_string_tab[69]
#define __pyx_kp_u_got_result_for_unknown_protocol __pyx_string_tab[70]
#define __pyx_kp_u_gssapi_module_not_found_please_i __pyx_string_tab[71]
#define __pyx_kp_u_in_element __pyx_string_tab[72]
#define __pyx_kp_u_inconsistent_sub_array_dimension __pyx_string_tab[73]
#define __pyx_kp_u_input_of_anonymous_composite_typ __pyx_string_tab[74]
#define __pyx_kp_u_invalid_array_element __pyx_string_tab[75]
#define __pyx_kp_u_invalid_array_element_at_index __pyx_string_tab[76]
#define __pyx_kp_u_invalid_data_format __pyx_string_tab[77]
#define __pyx_kp_u_invalid_format_argument_expected __pyx_string_tab[78]
#define __pyx_kp_u_invalid_input_for_query_argument __pyx_string_tab[79]
#define __pyx_kp_u_invalid_input_in_executemany_arg __pyx_string_tab[80]
#define __pyx_kp_u_invalid_nonce __pyx_string_tab[81]
#define __pyx_kp_u_invalid_timeout_value_expected_n __pyx_string_tab[82]
#define __pyx_kp_u_isenabled __pyx_string_tab[83]
#define __pyx_kp_u_list_tuple_or_Range_object_expec __pyx_string_tab[84]
#define __pyx_kp_u_malformed_array_literal_r __pyx_string_tab[85]
#define __pyx_kp_u_missing_after_array_dimensions __pyx_string_tab[86]
#define __pyx_kp_u_missing_after_array_dimensions_2 __pyx_string_tab[87]
#define __pyx_kp_u_missing_array_dimension_value __pyx_string_tab[88]
#define __pyx_kp_u_missing_codec_information_for_OI __pyx_string_tab[89]
#define __pyx_kp_u_named_prepared_statements_cannot __pyx_string_tab[90]
#define __pyx_kp_u_no_binary_format_encoder_for_typ __pyx_string_tab[91]
#define __pyx_kp_u_no_codec_for_composite_attribute __pyx_string_tab[92]
#define __pyx_kp_u_no_decoder_for_OID __pyx_string_tab[93]
#define __pyx_kp_u_no_decoder_for_composite_type_el __pyx_string_tab[94]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[95]
#define __pyx_kp_u_no_encoder_for_OID __pyx_string_tab[96]
#define __pyx_kp_u_non_homogeneous_array __pyx_string_tab[97]
#define __pyx_kp_u_not_connected __pyx_string_tab[98]
#define __pyx_kp_u_number_of_array_dimensions_excee __pyx_string_tab[99]
#define __pyx_kp_u_of_executemany_sequence __pyx_string_tab[100]
#define __pyx_kp_u_oid_2 __pyx_string_tab[101]
#define __pyx_kp_u_on_result__prepare_statement_is __pyx_string_tab[102]
#define __pyx_kp_u_on_result_waiter_is_None __pyx_string_tab[103]
#define __pyx_kp_u_on_result_waiter_is_done __pyx_string_tab[104]
#define __pyx_kp_u_parse_data_msgs_first_message_i __pyx_string_tab[105]
#define __pyx_kp_u_parse_data_msgs_result_is_not_a __pyx_string_tab[106]
#define __pyx_kp_u_pg_contrib_hstore __pyx_string_tab[107]
#define __pyx_kp_u_protocol_is_in_an_unexpected_st __pyx_string_tab[108]
#define __pyx_kp_u_query_argument __pyx_string_tab[109]
#define __pyx_kp_u_r_is_not_a_valid_element_of_com __pyx_string_tab[110]
#define __pyx_kp_u_reader_is_not_an_asynchronous_it __pyx_string_tab[111]
#define __pyx_kp_u_scram_sha_256 __pyx_string_tab[112]
#define __pyx_kp_u_size_of_encoded_multirange_datum __pyx_string_tab[113]
#define __pyx_kp_u_specified_array_dimensions_do_no __pyx_string_tab[114]
#define __pyx_kp_u_sspilib_module_not_found_please __pyx_string_tab[115]
#define __pyx_kp_u_text_2 __pyx_string_tab[116]
#define __pyx_kp_u_text_binary_or_tuple __pyx_string_tab[117]
#define __pyx_kp_u_text_or_binary __pyx_string_tab[118]
#define __pyx_kp_u_text_or_binary_2 __pyx_string_tab[119]
#define __pyx_kp_u_the_number_of_columns_in_the_res __pyx_string_tab[120]
#define __pyx_kp_u_the_number_of_query_arguments_ca __pyx_string_tab[121]
#define __pyx_kp_u_the_server_expects_x_argument_s __pyx_string_tab[122]
#define __pyx_kp_u_there_is_no __pyx_string_tab[123]
#define __pyx_kp_u_time_with_timezone __pyx_string_tab[124]
#define __pyx_kp_u_time_without_timezone __pyx_string_tab[125]
#define __pyx_kp_u_timestamp_with_timezone __pyx_string_tab[126]
#define __pyx_kp_u_timestamp_without_timezone __pyx_string_tab[127]
#define __pyx_kp_u_to __pyx_string_tab[128]
#define __pyx_kp_u_too_many_elements_in_array_value __pyx_string_tab[129]
#define __pyx_kp_u_too_many_elements_in_composite_t __pyx_string_tab[130]
#define __pyx_kp_u_too_many_elements_in_multirange __pyx_string_tab[131]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[132]
#define __pyx_kp_u_type_does_not_support_the_tuple __pyx_string_tab[133]
#define __pyx_kp_u_type_record_missing_base_type_fo __pyx_string_tab[134]
#define __pyx_kp_u_type_record_missing_base_type_fo_2 __pyx_string_tab[135]
#define __pyx_kp_u_type_record_missing_base_type_fo_3 __pyx_string_tab[136]
#define __pyx_kp_u_type_record_missing_field_types __pyx_string_tab[137]
#define __pyx_kp_u_unexpected_NULL_element_in_multi __pyx_string_tab[138]
#define __pyx_kp_u_unexpected_array_dimension_size __pyx_string_tab[139]
#define __pyx_kp_u_unexpected_array_dimensions_valu __pyx_string_tab[140]
#define __pyx_kp_u_unexpected_character_r_at_positi __pyx_string_tab[141]
#define __pyx_kp_u_unexpected_codec_type __pyx_string_tab[142]
#define __pyx_kp_u_unexpected_data_format __pyx_string_tab[143]
#define __pyx_kp_u_unexpected_data_type_of_composit __pyx_string_tab[144]
#define __pyx_kp_u_unexpected_end_of_string __pyx_string_tab[145]
#define __pyx_kp_u_unexpected_error_while_performin __pyx_string_tab[146]
#define __pyx_kp_u_unexpected_exchange_format __pyx_string_tab[147]
#define __pyx_kp_u_unexpected_multirange_size_value __pyx_string_tab[148]
#define __pyx_kp_u_unexpected_number_of_attributes __pyx_string_tab[149]
#define __pyx_kp_u_unexpected_trailing_bytes_in_buf __pyx_string_tab[150]
#define __pyx_kp_u_unhandled_standard_data_type __pyx_string_tab[151]
#define __pyx_kp_u_unknown_error_in_protocol_implem __pyx_string_tab[152]
#define __pyx_kp_u_unsupported_SASL_Authentication __pyx_string_tab[153]
#define __pyx_kp_u_unsupported_authentication_metho __pyx_string_tab[154]
#define __pyx_kp_u_utf_8 __pyx_string_tab[155]
#define __pyx_kp_u_waiter_is_not_done_while_handlin __pyx_string_tab[156]
#define __pyx_kp_u_you_need_values_from_server_to_g __pyx_string_tab[157]
#define __pyx_n_u_AF_UNIX __pyx_string_tab[158]
#define __pyx_n_u_ARRAY_TYPES __pyx_string_tab[159]
#define __pyx_n_u_AUTHENTICATION_METHODS __pyx_string_tab[160]
#define __pyx_n_u_AUTH_METHOD_NAME __pyx_string_tab[161]
#define __pyx_n_u_AsyncIterable __pyx_string_tab[162]
#define __pyx_n_u_Attribute __pyx_string_tab[163]
#define __pyx_n_u_BUILTIN_TYPE_NAME_MAP __pyx_string_tab[164]
#define __pyx_n_u_BUILTIN_TYPE_OID_MAP __pyx_string_tab[165]
#define __pyx_n_u_BaseProtocol __pyx_string_tab[166]
#define __pyx_n_u_BaseProtocol___reduce_cython __pyx_string_tab[167]
#define __pyx_n_u_BaseProtocol___setstate_cython __pyx_string_tab[168]
#define __pyx_n_u_BaseProtocol__create_future_fall __pyx_string_tab[169]
#define __pyx_n_u_BaseProtocol__get_timeout __pyx_string_tab[170]
#define __pyx_n_u_BaseProtocol__is_cancelling __pyx_string_tab[171]
#define __pyx_n_u_BaseProtocol__on_timeout __pyx_string_tab[172]
#define __pyx_n_u_BaseProtocol__on_waiter_complete __pyx_string_tab[173]
#define __pyx_n_u_BaseProtocol__request_cancel __pyx_string_tab[174]
#define __pyx_n_u_BaseProtocol__wait_for_cancellat __pyx_string_tab[175]
#define __pyx_n_u_BaseProtocol_abort __pyx_string_tab[176]
#define __pyx_n_u_BaseProtocol_bind __pyx_string_tab[177]
#define __pyx_n_u_BaseProtocol_bind_execute __pyx_string_tab[178]
#define __pyx_n_u_BaseProtocol_bind_execute_many __pyx_string_tab[179]
#define __pyx_n_u_BaseProtocol_close __pyx_string_tab[180]
#define __pyx_n_u_BaseProtocol_close_portal __pyx_string_tab[181]
#define __pyx_n_u_BaseProtocol_close_statement __pyx_string_tab[182]
#define __pyx_n_u_BaseProtocol_connection_lost __pyx_string_tab[183]
#define __pyx_n_u_BaseProtocol_connection_made __pyx_string_tab[184]
#define __pyx_n_u_BaseProtocol_copy_in __pyx_string_tab[185]
#define __pyx_n_u_BaseProtocol_copy_out __pyx_string_tab[186]
#define __pyx_n_u_BaseProtocol_data_received __pyx_string_tab[187]
#define __pyx_n_u_BaseProtocol_execute __pyx_string_tab[188]
#define __pyx_n_u_BaseProtocol_get_record_class __pyx_string_tab[189]
#define __pyx_n_u_BaseProtocol_get_server_pid __pyx_string_tab[190]
#define __pyx_n_u_BaseProtocol_get_settings __pyx_string_tab[191]
#define __pyx_n_u_BaseProtocol_is_closed __pyx_string_tab[192]
#define __pyx_n_u_BaseProtocol_is_connected __pyx_string_tab[193]
#define __pyx_n_u_BaseProtocol_pause_writing __pyx_string_tab[194]
#define __pyx_n_u_BaseProtocol_prepare __pyx_string_tab[195]
#define __pyx_n_u_BaseProtocol_query __pyx_string_tab[196]
#define __pyx_n_u_BaseProtocol_resume_writing __pyx_string_tab[197]
#define __pyx_n_u_BaseProtocol_set_connection __pyx_string_tab[198]
#define __pyx_n_u_CancelledError __pyx_string_tab[199]
#define __pyx_n_u_ClientSecurityContext __pyx_string_tab[200]
#define __pyx_n_u_Codec __pyx_string_tab[201]
#define __pyx_n_u_CodecMap __pyx_string_tab[202]
#define __pyx_n_u_CodecMap___reduce_cython __pyx_string_tab[203]
#define __pyx_n_u_CodecMap___setstate_cython __pyx_string_tab[204]
#define __pyx_n_u_Codec___reduce_cython __pyx_string_tab[205]
#define __pyx_n_u_Codec___setstate_cython __pyx_string_tab[206]
#define __pyx_n_u_ConnectionDoesNotExistError __pyx_string_tab[207]
#define __pyx_n_u_ConnectionSettings __pyx_string_tab[208]
#define __pyx_n_u_ConnectionSettings___reduce_cyth __pyx_string_tab[209]
#define __pyx_n_u_ConnectionSettings___setstate_cy __pyx_string_tab[210]
#define __pyx_n_u_ConnectionSettings_add_python_co __pyx_string_tab[211]
#define __pyx_n_u_ConnectionSettings_clear_type_ca __pyx_string_tab[212]
#define __pyx_n_u_ConnectionSettings_get_data_code __pyx_string_tab[213]
#define __pyx_n_u_ConnectionSettings_get_text_code __pyx_string_tab[214]
#define __pyx_n_u_ConnectionSettings_register_data __pyx_string_tab[215]
#define __pyx_n_u_ConnectionSettings_remove_python __pyx_string_tab[216]
#define __pyx_n_u_ConnectionSettings_set_builtin_t __pyx_string_tab[217]
#define __pyx_n_u_CoreProtocol __pyx_string_tab[218]
#define __pyx_n_u_CoreProtocol___reduce_cython __pyx_string_tab[219]
#define __pyx_n_u_CoreProtocol___setstate_cython __pyx_string_tab[220]
#define __pyx_n_u_CoreProtocol_is_in_transaction __pyx_string_tab[221]
#define __pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES __pyx_string_tab[222]
#define __pyx_n_u_DIGEST __pyx_string_tab[223]
#define __pyx_n_u_DataCodecConfig __pyx_string_tab[224]
#define __pyx_n_u_DataCodecConfig___reduce_cython __pyx_string_tab[225]
#define __pyx_n_u_DataCodecConfig___setstate_cytho __pyx_string_tab[226]
#define __pyx_n_u_DataCodecConfig__set_builtin_typ __pyx_string_tab[227]
#define __pyx_n_u_DataCodecConfig_add_python_codec __pyx_string_tab[228]
#define __pyx_n_u_DataCodecConfig_add_types __pyx_string_tab[229]
#define __pyx_n_u_DataCodecConfig_clear_type_cache __pyx_string_tab[230]
#define __pyx_n_u_DataCodecConfig_declare_fallback __pyx_string_tab[231]
#define __pyx_n_u_DataCodecConfig_remove_python_co __pyx_string_tab[232]
#define __pyx_n_u_DataCodecConfig_set_builtin_type __pyx_string_tab[233]
#define __pyx_n_u_DataError __pyx_string_tab[234]
#define __pyx_n_u_ENCODINGS_MAP __pyx_string_tab[235]
#define __pyx_n_u_Event __pyx_string_tab[236]
#define __pyx_n_u_FLUSH_MESSAGE __pyx_string_tab[237]
#define __pyx_n_u_Future __pyx_string_tab[238]
#define __pyx_n_u_IPPROTO_TCP __pyx_string_tab[239]
#define __pyx_n_u_InterfaceError __pyx_string_tab[240]
#define __pyx_n_u_InternalClientError __pyx_string_tab[241]
#define __pyx_n_u_Iterable __pyx_string_tab[242]
#define __pyx_n_u_IterableABC __pyx_string_tab[243]
#define __pyx_n_u_Kerberos __pyx_string_tab[244]
#define __pyx_n_u_Mapping __pyx_string_tab[245]
#define __pyx_n_u_MappingABC __pyx_string_tab[246]
#define __pyx_n_u_NA __pyx_string_tab[247]
#define __pyx_n_u_NFKC __pyx_string_tab[248]
#define __pyx_n_u_NO_TIMEOUT __pyx_string_tab[249]
#define __pyx_n_u_Name __pyx_string_tab[250]
#define __pyx_n_u_NameType __pyx_string_tab[251]
#define __pyx_n_u_Negotiate __pyx_string_tab[252]
#define __pyx_n_u_OrderedDict __pyx_string_tab[253]
#define __pyx_n_u_OutdatedSchemaCacheError __pyx_string_tab[254]
#define __pyx_n_u_PostgresError __pyx_string_tab[255]
#define __pyx_n_u_PreparedStatementState __pyx_string_tab[256]
#define __pyx_n_u_PreparedStatementState___reduce __pyx_string_tab[257]
#define __pyx_n_u_PreparedStatementState___setstat __pyx_string_tab[258]
#define __pyx_n_u_PreparedStatementState__get_attr __pyx_string_tab[259]
#define __pyx_n_u_PreparedStatementState__get_para __pyx_string_tab[260]
#define __pyx_n_u_PreparedStatementState__init_cod __pyx_string_tab[261]
#define __pyx_n_u_PreparedStatementState__init_typ __pyx_string_tab[262]
#define __pyx_n_u_PreparedStatementState_attach __pyx_string_tab[263]
#define __pyx_n_u_PreparedStatementState_detach __pyx_string_tab[264]
#define __pyx_n_u_PreparedStatementState_mark_clos __pyx_string_tab[265]
#define __pyx_n_u_PreparedStatementState_mark_unpr __pyx_string_tab[266]
#define __pyx_n_u_Protocol __pyx_string_tab[267]
#define __pyx_n_u_ProtocolError __pyx_string_tab[268]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[269]
#define __pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG __pyx_string_tab[270]
#define __pyx_n_u_REQUIREMENTS_CLIENT_PROOF __pyx_string_tab[271]
#define __pyx_n_u_ROLLBACK __pyx_string_tab[272]
#define __pyx_n_u_Range __pyx_string_tab[273]
#define __pyx_n_u_Record __pyx_string_tab[274]
#define __pyx_n_u_RecordDescriptor __pyx_string_tab[275]
#define __pyx_n_u_SASLPREP_PROHIBITED __pyx_string_tab[276]
#define __pyx_n_u_SCRAMAuthentication __pyx_string_tab[277]
#define __pyx_n_u_SCRAMAuthentication___reduce_cyt __pyx_string_tab[278]
#define __pyx_n_u_SCRAMAuthentication___setstate_c __pyx_string_tab[279]
#define __pyx_n_u_SCRAMAuthentication__bytes_xor_l __pyx_string_tab[280]
#define __pyx_n_u_SCRAMAuthentication__normalize_p __pyx_string_tab[281]
#define __pyx_n_u_SYNC_MESSAGE __pyx_string_tab[282]
#define __pyx_n_u_SecurityContext __pyx_string_tab[283]
#define __pyx_n_u_Sequence __pyx_string_tab[284]
#define __pyx_n_u_SequenceABC __pyx_string_tab[285]
#define __pyx_n_u_Sized __pyx_string_tab[286]
#define __pyx_n_u_SizedABC __pyx_string_tab[287]
#define __pyx_n_u_StopAsyncIteration __pyx_string_tab[288]
#define __pyx_n_u_TCP_NODELAY __pyx_string_tab[289]
#define __pyx_n_u_TimeoutError __pyx_string_tab[290]
#define __pyx_n_u_Timer __pyx_string_tab[291]
#define __pyx_n_u_Timer___enter __pyx_string_tab[292]
#define __pyx_n_u_Timer___exit __pyx_string_tab[293]
#define __pyx_n_u_Timer___init __pyx_string_tab[294]
#define __pyx_n_u_Timer_get_remaining_budget __pyx_string_tab[295]
#define __pyx_n_u_Timer_has_budget_greater_than __pyx_string_tab[296]
#define __pyx_n_u_Type __pyx_string_tab[297]
#define __pyx_n_u_UnsupportedClientFeatureError __pyx_string_tab[298]
#define __pyx_n_u_UserCredential __pyx_string_tab[299]
#define __pyx_n_u__2 __pyx_string_tab[300]
#define __pyx_n_u_a_i __pyx_string_tab[301]
#define __pyx_n_u_abc __pyx_string_tab[302]
#define __pyx_n_u_abort __pyx_string_tab[303]
#define __pyx_n_u_abstime __pyx_string_tab[304]
#define __pyx_n_u_aclitem __pyx_string_tab[305]
#define __pyx_n_u_add_done_callback __pyx_string_tab[306]
#define __pyx_n_u_add_python_codec __pyx_string_tab[307]
#define __pyx_n_u_add_types __pyx_string_tab[308]
#define __pyx_n_u_addr __pyx_string_tab[309]
#define __pyx_n_u_aiter __pyx_string_tab[310]
#define __pyx_n_u_aiter_2 __pyx_string_tab[311]
#define __pyx_n_u_alias_oid __pyx_string_tab[312]
#define __pyx_n_u_alias_to __pyx_string_tab[313]
#define __pyx_n_u_alt __pyx_string_tab[314]
#define __pyx_n_u_amount __pyx_string_tab[315]
#define __pyx_n_u_anext __pyx_string_tab[316]
#define __pyx_n_u_annotate __pyx_string_tab[317]
#define __pyx_n_u_any __pyx_string_tab[318]
#define __pyx_n_u_anyarray __pyx_string_tab[319]
#define __pyx_n_u_anycompatible __pyx_string_tab[320]
#define __pyx_n_u_anycompatiblearray __pyx_string_tab[321]
#define __pyx_n_u_anycompatiblemultirange __pyx_string_tab[322]
#define __pyx_n_u_anycompatiblenonarray __pyx_string_tab[323]
#define __pyx_n_u_anycompatiblerange __pyx_string_tab[324]
#define __pyx_n_u_anyelement __pyx_string_tab[325]
#define __pyx_n_u_anyenum __pyx_string_tab[326]
#define __pyx_n_u_anymultirange __pyx_string_tab[327]
#define __pyx_n_u_anynonarray __pyx_string_tab[328]
#define __pyx_n_u_anyrange __pyx_string_tab[329]
#define __pyx_n_u_apg_exc __pyx_string_tab[330]
#define __pyx_n_u_apg_exc_base __pyx_string_tab[331]
#define __pyx_n_u_apg_types __pyx_string_tab[332]
#define __pyx_n_u_arg_bufs __pyx_string_tab[333]
#define __pyx_n_u_args __pyx_string_tab[334]
#define __pyx_n_u_args_buf __pyx_string_tab[335]
#define __pyx_n_u_array __pyx_string_tab[336]
#define __pyx_n_u_array_element_oid __pyx_string_tab[337]
#define __pyx_n_u_ascii __pyx_string_tab[338]
#define __pyx_n_u_asyncio __pyx_string_tab[339]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[340]
#define __pyx_n_u_asyncpg __pyx_string_tab[341]
#define __pyx_n_u_asyncpg_exceptions __pyx_string_tab[342]
#define __pyx_n_u_asyncpg_protocol_protocol __pyx_string_tab[343]
#define __pyx_n_u_asyncpg_protocol_record __pyx_string_tab[344]
#define __pyx_n_u_attach __pyx_string_tab[345]
#define __pyx_n_u_attrname __pyx_string_tab[346]
#define __pyx_n_u_attrnames __pyx_string_tab[347]
#define __pyx_n_u_attrtypoids __pyx_string_tab[348]
#define __pyx_n_u_auth_msg __pyx_string_tab[349]
#define __pyx_n_u_authentication_method __pyx_string_tab[350]
#define __pyx_n_u_await __pyx_string_tab[351]
#define __pyx_n_u_b __pyx_string_tab[352]
#define __pyx_n_u_b64decode __pyx_string_tab[353]
#define __pyx_n_u_b64encode __pyx_string_tab[354]
#define __pyx_n_u_b_i __pyx_string_tab[355]
#define __pyx_n_u_base __pyx_string_tab[356]
#define __pyx_n_u_base64 __pyx_string_tab[357]
#define __pyx_n_u_base_codec __pyx_string_tab[358]
#define __pyx_n_u_base_type __pyx_string_tab[359]
#define __pyx_n_u_basetype __pyx_string_tab[360]
#define __pyx_n_u_basetype_name __pyx_string_tab[361]
#define __pyx_n_u_big __pyx_string_tab[362]
#define __pyx_n_u_bigint __pyx_string_tab[363]
#define __pyx_n_u_binary __pyx_string_tab[364]
#define __pyx_n_u_bind __pyx_string_tab[365]
#define __pyx_n_u_bind_execute __pyx_string_tab[366]
#define __pyx_n_u_bind_execute_many __pyx_string_tab[367]
#define __pyx_n_u_bind_execute_many_locals_genexpr __pyx_string_tab[368]
#define __pyx_n_u_bit __pyx_string_tab[369]
#define __pyx_n_u_bool __pyx_string_tab[370]
#define __pyx_n_u_box __pyx_string_tab[371]
#define __pyx_n_u_bpchar __pyx_string_tab[372]
#define __pyx_n_u_budget __pyx_string_tab[373]
#define __pyx_n_u_budget_2 __pyx_string_tab[374]
#define __pyx_n_u_buffer __pyx_string_tab[375]
#define __pyx_n_u_builtins __pyx_string_tab[376]
#define __pyx_n_u_bytea __pyx_string_tab[377]
#define __pyx_n_u_byteorder __pyx_string_tab[378]
#define __pyx_n_u_c __pyx_string_tab[379]
#define __pyx_n_u_c_decoder __pyx_string_tab[380]
#define __pyx_n_u_c_encoder __pyx_string_tab[381]
#define __pyx_n_u_call_exception_handler __pyx_string_tab[382]
#define __pyx_n_u_call_later __pyx_string_tab[383]
#define __pyx_n_u_cancel __pyx_string_tab[384]
#define __pyx_n_u_cancel_current_command __pyx_string_tab[385]
#define __pyx_n_u_cancelled __pyx_string_tab[386]
#define __pyx_n_u_cause __pyx_string_tab[387]
#define __pyx_n_u_char __pyx_string_tab[388]
#define __pyx_n_u_character __pyx_string_tab[389]
#define __pyx_n_u_chunk __pyx_string_tab[390]
#define __pyx_n_u_cid __pyx_string_tab[391]
#define __pyx_n_u_cidr __pyx_string_tab[392]
#define __pyx_n_u_circle __pyx_string_tab[393]
#define __pyx_n_u_class_getitem __pyx_string_tab[394]
#define __pyx_n_u_cleanup __pyx_string_tab[395]
#define __pyx_n_u_clear __pyx_string_tab[396]
#define __pyx_n_u_clear_type_cache __pyx_string_tab[397]
#define __pyx_n_u_client_channel_binding __pyx_string_tab[398]
#define __pyx_n_u_client_encoding __pyx_string_tab[399]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[400]
#define __pyx_n_u_close __pyx_string_tab[401]
#define __pyx_n_u_close_portal __pyx_string_tab[402]
#define __pyx_n_u_close_statement __pyx_string_tab[403]
#define __pyx_n_u_codec __pyx_string_tab[404]
#define __pyx_n_u_codec_map __pyx_string_tab[405]
#define __pyx_n_u_codec_set __pyx_string_tab[406]
#define __pyx_n_u_codec_str __pyx_string_tab[407]
#define __pyx_n_u_codecs __pyx_string_tab[408]
#define __pyx_n_u_collections __pyx_string_tab[409]
#define __pyx_n_u_collections_abc __pyx_string_tab[410]
#define __pyx_n_u_command_timeout __pyx_string_tab[411]
#define __pyx_n_u_comp_elem_codecs __pyx_string_tab[412]
#define __pyx_n_u_comp_type_attrs __pyx_string_tab[413]
#define __pyx_n_u_compat __pyx_string_tab[414]
#define __pyx_n_u_composite __pyx_string_tab[415]
#define __pyx_n_u_con __pyx_string_tab[416]
#define __pyx_n_u_con_params __pyx_string_tab[417]
#define __pyx_n_u_config __pyx_string_tab[418]
#define __pyx_n_u_connected_fut __pyx_string_tab[419]
#define __pyx_n_u_connection __pyx_string_tab[420]
#define __pyx_n_u_connection_lost __pyx_string_tab[421]
#define __pyx_n_u_connection_made __pyx_string_tab[422]
#define __pyx_n_u_copy_in __pyx_string_tab[423]
#define __pyx_n_u_copy_in_locals_lambda __pyx_string_tab[424]
#define __pyx_n_u_copy_out __pyx_string_tab[425]
#define __pyx_n_u_copy_out_locals_lambda __pyx_string_tab[426]
#define __pyx_n_u_copy_stmt __pyx_string_tab[427]
#define __pyx_n_u_core_codec __pyx_string_tab[428]
#define __pyx_n_u_cp1250 __pyx_string_tab[429]
#define __pyx_n_u_cp1251 __pyx_string_tab[430]
#define __pyx_n_u_cp1252 __pyx_string_tab[431]
#define __pyx_n_u_cp1253 __pyx_string_tab[432]
#define __pyx_n_u_cp1254 __pyx_string_tab[433]
#define __pyx_n_u_cp1255 __pyx_string_tab[434]
#define __pyx_n_u_cp1256 __pyx_string_tab[435]
#define __pyx_n_u_cp1257 __pyx_string_tab[436]
#define __pyx_n_u_cp1258 __pyx_string_tab[437]
#define __pyx_n_u_cp1521 __pyx_string_tab[438]
#define __pyx_n_u_cp866 __pyx_string_tab[439]
#define __pyx_n_u_cp874 __pyx_string_tab[440]
#define __pyx_n_u_cp932 __pyx_string_tab[441]
#define __pyx_n_u_cp936 __pyx_string_tab[442]
#define __pyx_n_u_cp949 __pyx_string_tab[443]
#define __pyx_n_u_cp950 __pyx_string_tab[444]
#define __pyx_n_u_create_future __pyx_string_tab[445]
#define __pyx_n_u_create_future_fallback __pyx_string_tab[446]
#define __pyx_n_u_create_record __pyx_string_tab[447]
#define __pyx_n_u_credential __pyx_string_tab[448]
#define __pyx_n_u_cstring __pyx_string_tab[449]
#define __pyx_n_u_d __pyx_string_tab[450]
#define __pyx_n_u_data __pyx_string_tab[451]
#define __pyx_n_u_data_gen __pyx_string_tab[452]
#define __pyx_n_u_data_received __pyx_string_tab[453]
#define __pyx_n_u_data_type __pyx_string_tab[454]
#define __pyx_n_u_database __pyx_string_tab[455]
#define __pyx_n_u_date __pyx_string_tab[456]
#define __pyx_n_u_decimal __pyx_string_tab[457]
#define __pyx_n_u_declare_fallback_codec __pyx_string_tab[458]
#define __pyx_n_u_decode __pyx_string_tab[459]
#define __pyx_n_u_decoder __pyx_string_tab[460]
#define __pyx_n_u_desc __pyx_string_tab[461]
#define __pyx_n_u_detach __pyx_string_tab[462]
#define __pyx_n_u_detail __pyx_string_tab[463]
#define __pyx_n_u_dict __pyx_string_tab[464]
#define __pyx_n_u_dict_2 __pyx_string_tab[465]
#define __pyx_n_u_digest __pyx_string_tab[466]
#define __pyx_n_u_doc __pyx_string_tab[467]
#define __pyx_n_u_done __pyx_string_tab[468]
#define __pyx_n_u_e __pyx_string_tab[469]
#define __pyx_n_u_elem __pyx_string_tab[470]
#define __pyx_n_u_elem_codec __pyx_string_tab[471]
#define __pyx_n_u_elem_delim __pyx_string_tab[472]
#define __pyx_n_u_elem_format __pyx_string_tab[473]
#define __pyx_n_u_elemdelim __pyx_string_tab[474]
#define __pyx_n_u_element_names __pyx_string_tab[475]
#define __pyx_n_u_elems __pyx_string_tab[476]
#define __pyx_n_u_elemtype __pyx_string_tab[477]
#define __pyx_n_u_elemtype_name __pyx_string_tab[478]
#define __pyx_n_u_empty __pyx_string_tab[479]
#define __pyx_n_u_encode __pyx_string_tab[480]
#define __pyx_n_u_encoder __pyx_string_tab[481]
#define __pyx_n_u_enter __pyx_string_tab[482]
#define __pyx_n_u_enumerate __pyx_string_tab[483]
#define __pyx_n_u_et __pyx_string_tab[484]
#define __pyx_n_u_euc_cn __pyx_string_tab[485]
#define __pyx_n_u_euc_jis_2004 __pyx_string_tab[486]
#define __pyx_n_u_euc_jp __pyx_string_tab[487]
#define __pyx_n_u_euc_kr __pyx_string_tab[488]
#define __pyx_n_u_euccn __pyx_string_tab[489]
#define __pyx_n_u_eucjp __pyx_string_tab[490]
#define __pyx_n_u_euckr __pyx_string_tab[491]
#define __pyx_n_u_event_trigger __pyx_string_tab[492]
#define __pyx_n_u_ex __pyx_string_tab[493]
#define __pyx_n_u_exc __pyx_string_tab[494]
#define __pyx_n_u_exception __pyx_string_tab[495]
#define __pyx_n_u_exceptions __pyx_string_tab[496]
#define __pyx_n_u_execute __pyx_string_tab[497]
#define __pyx_n_u_exit __pyx_string_tab[498]
#define __pyx_n_u_f __pyx_string_tab[499]
#define __pyx_n_u_family __pyx_string_tab[500]
#define __pyx_n_u_fdw_handler __pyx_string_tab[501]
#define __pyx_n_u_float4 __pyx_string_tab[502]
#define __pyx_n_u_float8 __pyx_string_tab[503]
#define __pyx_n_u_fmt __pyx_string_tab[504]
#define __pyx_n_u_format __pyx_string_tab[505]
#define __pyx_n_u_formats __pyx_string_tab[506]
#define __pyx_n_u_func __pyx_string_tab[507]
#define __pyx_n_u_fut __pyx_string_tab[508]
#define __pyx_n_u_genexpr __pyx_string_tab[509]
#define __pyx_n_u_get __pyx_string_tab[510]
#define __pyx_n_u_get_attributes __pyx_string_tab[511]
#define __pyx_n_u_get_data_codec __pyx_string_tab[512]
#define __pyx_n_u_get_extra_info __pyx_string_tab[513]
#define __pyx_n_u_get_parameters __pyx_string_tab[514]
#define __pyx_n_u_get_record_class __pyx_string_tab[515]
#define __pyx_n_u_get_remaining_budget __pyx_string_tab[516]
#define __pyx_n_u_get_server_pid __pyx_string_tab[517]
#define __pyx_n_u_get_settings __pyx_string_tab[518]
#define __pyx_n_u_get_text_codec __pyx_string_tab[519]
#define __pyx_n_u_get_timeout __pyx_string_tab[520]
#define __pyx_n_u_getattribute __pyx_string_tab[521]
#define __pyx_n_u_getstate __pyx_string_tab[522]
#define __pyx_n_u_group __pyx_string_tab[523]
#define __pyx_n_u_gss __pyx_string_tab[524]
#define __pyx_n_u_gssapi __pyx_string_tab[525]
#define __pyx_n_u_gsslib __pyx_string_tab[526]
#define __pyx_n_u_gtsvector __pyx_string_tab[527]
#define __pyx_n_u_has_budget_greater_than __pyx_string_tab[528]
#define __pyx_n_u_has_text_elements __pyx_string_tab[529]
#define __pyx_n_u_hashlib __pyx_string_tab[530]
#define __pyx_n_u_hexdigest __pyx_string_tab[531]
#define __pyx_n_u_hint __pyx_string_tab[532]
#define __pyx_n_u_hmac __pyx_string_tab[533]
#define __pyx_n_u_hostbased_service __pyx_string_tab[534]
#define __pyx_n_u_i __pyx_string_tab[535]
#define __pyx_n_u_ignore_custom_codec __pyx_string_tab[536]
#define __pyx_n_u_in_prohibited_table __pyx_string_tab[537]
#define __pyx_n_u_in_table_a1 __pyx_string_tab[538]
#define __pyx_n_u_in_table_b1 __pyx_string_tab[539]
#define __pyx_n_u_in_table_c12 __pyx_string_tab[540]
#define __pyx_n_u_in_table_c21_c22 __pyx_string_tab[541]
#define __pyx_n_u_in_table_c3 __pyx_string_tab[542]
#define __pyx_n_u_in_table_c4 __pyx_string_tab[543]
#define __pyx_n_u_in_table_c5 __pyx_string_tab[544]
#define __pyx_n_u_in_table_c6 __pyx_string_tab[545]
#define __pyx_n_u_in_table_c7 __pyx_string_tab[546]
#define __pyx_n_u_in_table_c8 __pyx_string_tab[547]
#define __pyx_n_u_in_table_c9 __pyx_string_tab[548]
#define __pyx_n_u_in_table_d1 __pyx_string_tab[549]
#define __pyx_n_u_in_table_d2 __pyx_string_tab[550]
#define __pyx_n_u_index_am_handler __pyx_string_tab[551]
#define __pyx_n_u_inet __pyx_string_tab[552]
#define __pyx_n_u_init __pyx_string_tab[553]
#define __pyx_n_u_init_codecs __pyx_string_tab[554]
#define __pyx_n_u_init_types __pyx_string_tab[555]
#define __pyx_n_u_initiate __pyx_string_tab[556]
#define __pyx_n_u_int __pyx_string_tab[557]
#define __pyx_n_u_int2 __pyx_string_tab[558]
#define __pyx_n_u_int4 __pyx_string_tab[559]
#define __pyx_n_u_int8 __pyx_string_tab[560]
#define __pyx_n_u_integer __pyx_string_tab[561]
#define __pyx_n_u_internal __pyx_string_tab[562]
#define __pyx_n_u_interval __pyx_string_tab[563]
#define __pyx_n_u_is_cancelling __pyx_string_tab[564]
#define __pyx_n_u_is_closed __pyx_string_tab[565]
#define __pyx_n_u_is_connected __pyx_string_tab[566]
#define __pyx_n_u_is_coroutine __pyx_string_tab[567]
#define __pyx_n_u_is_in_transaction __pyx_string_tab[568]
#define __pyx_n_u_isempty __pyx_string_tab[569]
#define __pyx_n_u_item __pyx_string_tab[570]
#define __pyx_n_u_items __pyx_string_tab[571]
#define __pyx_n_u_iterator __pyx_string_tab[572]
#define __pyx_n_u_json __pyx_string_tab[573]
#define __pyx_n_u_jsonb __pyx_string_tab[574]
#define __pyx_n_u_jsonpath __pyx_string_tab[575]
#define __pyx_n_u_kerberosv5 __pyx_string_tab[576]
#define __pyx_n_u_kind __pyx_string_tab[577]
#define __pyx_n_u_koi8_r __pyx_string_tab[578]
#define __pyx_n_u_koi8_u __pyx_string_tab[579]
#define __pyx_n_u_koi8r __pyx_string_tab[580]
#define __pyx_n_u_koi8u __pyx_string_tab[581]
#define __pyx_n_u_krbsrvname __pyx_string_tab[582]
#define __pyx_n_u_lambda __pyx_string_tab[583]
#define __pyx_n_u_language_handler __pyx_string_tab[584]
#define __pyx_n_u_limit __pyx_string_tab[585]
#define __pyx_n_u_line __pyx_string_tab[586]
#define __pyx_n_u_lookup __pyx_string_tab[587]
#define __pyx_n_u_loop __pyx_string_tab[588]
#define __pyx_n_u_lower __pyx_string_tab[589]
#define __pyx_n_u_lower_inc __pyx_string_tab[590]
#define __pyx_n_u_lseg __pyx_string_tab[591]
#define __pyx_n_u_macaddr __pyx_string_tab[592]
#define __pyx_n_u_macaddr8 __pyx_string_tab[593]
#define __pyx_n_u_main __pyx_string_tab[594]
#define __pyx_n_u_make_record __pyx_string_tab[595]
#define __pyx_n_u_mapping __pyx_string_tab[596]
#define __pyx_n_u_mark_closed __pyx_string_tab[597]
#define __pyx_n_u_mark_unprepared __pyx_string_tab[598]
#define __pyx_n_u_md5 __pyx_string_tab[599]
#define __pyx_n_u_message __pyx_string_tab[600]
#define __pyx_n_u_metaclass __pyx_string_tab[601]
#define __pyx_n_u_missing __pyx_string_tab[602]
#define __pyx_n_u_module __pyx_string_tab[603]
#define __pyx_n_u_money __pyx_string_tab[604]
#define __pyx_n_u_monotonic __pyx_string_tab[605]
#define __pyx_n_u_more __pyx_string_tab[606]
#define __pyx_n_u_mro_entries __pyx_string_tab[607]
#define __pyx_n_u_multirange __pyx_string_tab[608]
#define __pyx_n_u_name __pyx_string_tab[609]
#define __pyx_n_u_name_2 __pyx_string_tab[610]
#define __pyx_n_u_new __pyx_string_tab[611]
#define __pyx_n_u_new_2 __pyx_string_tab[612]
#define __pyx_n_u_next __pyx_string_tab[613]
#define __pyx_n_u_normalize __pyx_string_tab[614]
#define __pyx_n_u_ns __pyx_string_tab[615]
#define __pyx_n_u_num_cols __pyx_string_tab[616]
#define __pyx_n_u_numeric __pyx_string_tab[617]
#define __pyx_n_u_object __pyx_string_tab[618]
#define __pyx_n_u_oid __pyx_string_tab[619]
#define __pyx_n_u_on_error __pyx_string_tab[620]
#define __pyx_n_u_on_timeout __pyx_string_tab[621]
#define __pyx_n_u_on_waiter_completed __pyx_string_tab[622]
#define __pyx_n_u_opaque __pyx_string_tab[623]
#define __pyx_n_u_p_oid __pyx_string_tab[624]
#define __pyx_n_u_password __pyx_string_tab[625]
#define __pyx_n_u_password_iterations __pyx_string_tab[626]
#define __pyx_n_u_password_salt __pyx_string_tab[627]
#define __pyx_n_u_path __pyx_string_tab[628]
#define __pyx_n_u_pause_reading __pyx_string_tab[629]
#define __pyx_n_u_pause_writing __pyx_string_tab[630]
#define __pyx_n_u_pg_brin_bloom_summary __pyx_string_tab[631]
#define __pyx_n_u_pg_brin_minmax_multi_summary __pyx_string_tab[632]
#define __pyx_n_u_pg_catalog __pyx_string_tab[633]
#define __pyx_n_u_pg_ddl_command __pyx_string_tab[634]
#define __pyx_n_u_pg_dependencies __pyx_string_tab[635]
#define __pyx_n_u_pg_lsn __pyx_string_tab[636]
#define __pyx_n_u_pg_mcv_list __pyx_string_tab[637]
#define __pyx_n_u_pg_ndistinct __pyx_string_tab[638]
#define __pyx_n_u_pg_node_tree __pyx_string_tab[639]
#define __pyx_n_u_pg_snapshot __pyx_string_tab[640]
#define __pyx_n_u_point __pyx_string_tab[641]
#define __pyx_n_u_polygon __pyx_string_tab[642]
#define __pyx_n_u_pop __pyx_string_tab[643]
#define __pyx_n_u_portal_name __pyx_string_tab[644]
#define __pyx_n_u_position __pyx_string_tab[645]
#define __pyx_n_u_postgres __pyx_string_tab[646]
#define __pyx_n_u_prepare __pyx_string_tab[647]
#define __pyx_n_u_prepare_2 __pyx_string_tab[648]
#define __pyx_n_u_process_log_message __pyx_string_tab[649]
#define __pyx_n_u_process_notification __pyx_string_tab[650]
#define __pyx_n_u_protocol __pyx_string_tab[651]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[652]
#define __pyx_n_u_pyx_result __pyx_string_tab[653]
#define __pyx_n_u_pyx_state __pyx_string_tab[654]
#define __pyx_n_u_pyx_type __pyx_string_tab[655]
#define __pyx_n_u_pyx_unpickle_BaseProtocol __pyx_string_tab[656]
#define __pyx_n_u_pyx_unpickle_CoreProtocol __pyx_string_tab[657]
#define __pyx_n_u_pyx_unpickle_DataCodecConfig __pyx_string_tab[658]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[659]
#define __pyx_n_u_qualname __pyx_string_tab[660]
#define __pyx_n_u_query __pyx_string_tab[661]
#define __pyx_n_u_range __pyx_string_tab[662]
#define __pyx_n_u_range_subtype __pyx_string_tab[663]
#define __pyx_n_u_range_subtype_name __pyx_string_tab[664]
#define __pyx_n_u_range_subtype_oid __pyx_string_tab[665]
#define __pyx_n_u_rdesc __pyx_string_tab[666]
#define __pyx_n_u_re __pyx_string_tab[667]
#define __pyx_n_u_reader __pyx_string_tab[668]
#define __pyx_n_u_real __pyx_string_tab[669]
#define __pyx_n_u_rec __pyx_string_tab[670]
#define __pyx_n_u_record __pyx_string_tab[671]
#define __pyx_n_u_record_class __pyx_string_tab[672]
#define __pyx_n_u_record_stmt __pyx_string_tab[673]
#define __pyx_n_u_records __pyx_string_tab[674]
#define __pyx_n_u_reduce __pyx_string_tab[675]
#define __pyx_n_u_reduce_cython __pyx_string_tab[676]
#define __pyx_n_u_reduce_ex __pyx_string_tab[677]
#define __pyx_n_u_ref __pyx_string_tab[678]
#define __pyx_n_u_refcursor __pyx_string_tab[679]
#define __pyx_n_u_regclass __pyx_string_tab[680]
#define __pyx_n_u_regcollation __pyx_string_tab[681]
#define __pyx_n_u_regconfig __pyx_string_tab[682]
#define __pyx_n_u_regdictionary __pyx_string_tab[683]
#define __pyx_n_u_register_data_types __pyx_string_tab[684]
#define __pyx_n_u_regnamespace __pyx_string_tab[685]
#define __pyx_n_u_regoper __pyx_string_tab[686]
#define __pyx_n_u_regoperator __pyx_string_tab[687]
#define __pyx_n_u_regproc __pyx_string_tab[688]
#define __pyx_n_u_regprocedure __pyx_string_tab[689]
#define __pyx_n_u_regrole __pyx_string_tab[690]
#define __pyx_n_u_regtype __pyx_string_tab[691]
#define __pyx_n_u_release __pyx_string_tab[692]
#define __pyx_n_u_reltime __pyx_string_tab[693]
#define __pyx_n_u_remove_python_codec __pyx_string_tab[694]
#define __pyx_n_u_request_cancel __pyx_string_tab[695]
#define __pyx_n_u_result __pyx_string_tab[696]
#define __pyx_n_u_resume_reading __pyx_string_tab[697]
#define __pyx_n_u_resume_writing __pyx_string_tab[698]
#define __pyx_n_u_return_extra __pyx_string_tab[699]
#define __pyx_n_u_return_rows __pyx_string_tab[700]
#define __pyx_n_u_reversed __pyx_string_tab[701]
#define __pyx_n_u_row __pyx_string_tab[702]
#define __pyx_n_u_s_2 __pyx_string_tab[703]
#define __pyx_n_u_scalar __pyx_string_tab[704]
#define __pyx_n_u_schema __pyx_string_tab[705]
#define __pyx_n_u_search __pyx_string_tab[706]
#define __pyx_n_u_secrets __pyx_string_tab[707]
#define __pyx_n_u_self __pyx_string_tab[708]
#define __pyx_n_u_send __pyx_string_tab[709]
#define __pyx_n_u_server_first_message __pyx_string_tab[710]
#define __pyx_n_u_server_nonce __pyx_string_tab[711]
#define __pyx_n_u_server_settings __pyx_string_tab[712]
#define __pyx_n_u_set __pyx_string_tab[713]
#define __pyx_n_u_set_builtin_type_codec __pyx_string_tab[714]
#define __pyx_n_u_set_builtin_type_codec_2 __pyx_string_tab[715]
#define __pyx_n_u_set_connection __pyx_string_tab[716]
#define __pyx_n_u_set_exception __pyx_string_tab[717]
#define __pyx_n_u_set_name __pyx_string_tab[718]
#define __pyx_n_u_set_result __pyx_string_tab[719]
#define __pyx_n_u_setdefault __pyx_string_tab[720]
#define __pyx_n_u_setsockopt __pyx_string_tab[721]
#define __pyx_n_u_setstate __pyx_string_tab[722]
#define __pyx_n_u_setstate_cython __pyx_string_tab[723]
#define __pyx_n_u_settings __pyx_string_tab[724]
#define __pyx_n_u_sha256 __pyx_string_tab[725]
#define __pyx_n_u_shift_jis __pyx_string_tab[726]
#define __pyx_n_u_shift_jis_2004 __pyx_string_tab[727]
#define __pyx_n_u_sink __pyx_string_tab[728]
#define __pyx_n_u_sjis __pyx_string_tab[729]
#define __pyx_n_u_sleep __pyx_string_tab[730]
#define __pyx_n_u_smallint __pyx_string_tab[731]
#define __pyx_n_u_smgr __pyx_string_tab[732]
#define __pyx_n_u_sock __pyx_string_tab[733]
#define __pyx_n_u_socket __pyx_string_tab[734]
#define __pyx_n_u_sql_ascii __pyx_string_tab[735]
#define __pyx_n_u_sspi __pyx_string_tab[736]
#define __pyx_n_u_sspilib __pyx_string_tab[737]
#define __pyx_n_u_started __pyx_string_tab[738]
#define __pyx_n_u_startswith __pyx_string_tab[739]
#define __pyx_n_u_state __pyx_string_tab[740]
#define __pyx_n_u_status_msg __pyx_string_tab[741]
#define __pyx_n_u_step __pyx_string_tab[742]
#define __pyx_n_u_stmt_name __pyx_string_tab[743]
#define __pyx_n_u_str __pyx_string_tab[744]
#define __pyx_n_u_stringprep __pyx_string_tab[745]
#define __pyx_n_u_table_am_handler __pyx_string_tab[746]
#define __pyx_n_u_target_codec __pyx_string_tab[747]
#define __pyx_n_u_target_name __pyx_string_tab[748]
#define __pyx_n_u_tb __pyx_string_tab[749]
#define __pyx_n_u_tcvn __pyx_string_tab[750]
#define __pyx_n_u_tcvn5712 __pyx_string_tab[751]
#define __pyx_n_u_test __pyx_string_tab[752]
#define __pyx_n_u_text __pyx_string_tab[753]
#define __pyx_n_u_throw __pyx_string_tab[754]
#define __pyx_n_u_ti __pyx_string_tab[755]
#define __pyx_n_u_tid __pyx_string_tab[756]
#define __pyx_n_u_time __pyx_string_tab[757]
#define __pyx_n_u_timeout __pyx_string_tab[758]
#define __pyx_n_u_timer __pyx_string_tab[759]
#define __pyx_n_u_timestamp __pyx_string_tab[760]
#define __pyx_n_u_timestamptz __pyx_string_tab[761]
#define __pyx_n_u_timetz __pyx_string_tab[762]
#define __pyx_n_u_tinterval __pyx_string_tab[763]
#define __pyx_n_u_to_bytes __pyx_string_tab[764]
#define __pyx_n_u_token_bytes __pyx_string_tab[765]
#define __pyx_n_u_transport __pyx_string_tab[766]
#define __pyx_n_u_trigger __pyx_string_tab[767]
#define __pyx_n_u_tsm_handler __pyx_string_tab[768]
#define __pyx_n_u_tsquery __pyx_string_tab[769]
#define __pyx_n_u_tsvector __pyx_string_tab[770]
#define __pyx_n_u_tuple __pyx_string_tab[771]
#define __pyx_n_u_txid_snapshot __pyx_string_tab[772]
#define __pyx_n_u_typeinfos __pyx_string_tab[773]
#define __pyx_n_u_typekind __pyx_string_tab[774]
#define __pyx_n_u_typename __pyx_string_tab[775]
#define __pyx_n_u_typeoid __pyx_string_tab[776]
#define __pyx_n_u_types __pyx_string_tab[777]
#define __pyx_n_u_typeschema __pyx_string_tab[778]
#define __pyx_n_u_typoid __pyx_string_tab[779]
#define __pyx_n_u_unicode __pyx_string_tab[780]
#define __pyx_n_u_unicodedata __pyx_string_tab[781]
#define __pyx_n_u_unknown __pyx_string_tab[782]
#define __pyx_n_u_update __pyx_string_tab[783]
#define __pyx_n_u_upper __pyx_string_tab[784]
#define __pyx_n_u_upper_inc __pyx_string_tab[785]
#define __pyx_n_u_usage __pyx_string_tab[786]
#define __pyx_n_u_use_setstate __pyx_string_tab[787]
#define __pyx_n_u_user __pyx_string_tab[788]
#define __pyx_n_u_utf_8_2 __pyx_string_tab[789]
#define __pyx_n_u_uuid __pyx_string_tab[790]
#define __pyx_n_u_value __pyx_string_tab[791]
#define __pyx_n_u_values __pyx_string_tab[792]
#define __pyx_n_u_varbit __pyx_string_tab[793]
#define __pyx_n_u_varchar __pyx_string_tab[794]
#define __pyx_n_u_void __pyx_string_tab[795]
#define __pyx_n_u_vscii __pyx_string_tab[796]
#define __pyx_n_u_w __pyx_string_tab[797]
#define __pyx_n_u_wait __pyx_string_tab[798]
#define __pyx_n_u_wait_for __pyx_string_tab[799]
#define __pyx_n_u_wait_for_cancellation __pyx_string_tab[800]
#define __pyx_n_u_waiter __pyx_string_tab[801]
#define __pyx_n_u_was __pyx_string_tab[802]
#define __pyx_n_u_wbuf __pyx_string_tab[803]
#define __pyx_n_u_weakref __pyx_string_tab[804]
#define __pyx_n_u_were __pyx_string_tab[805]
#define __pyx_n_u_win __pyx_string_tab[806]
#define __pyx_n_u_win1250 __pyx_string_tab[807]
#define __pyx_n_u_win1251 __pyx_string_tab[808]
#define __pyx_n_u_win1252 __pyx_string_tab[809]
#define __pyx_n_u_win1253 __pyx_string_tab[810]
#define __pyx_n_u_win1254 __pyx_string_tab[811]
#define __pyx_n_u_win1255 __pyx_string_tab[812]
#define __pyx_n_u_win1256 __pyx_string_tab[813]
#define __pyx_n_u_win1257 __pyx_string_tab[814]
#define __pyx_n_u_win1258 __pyx_string_tab[815]
#define __pyx_n_u_win866 __pyx_string_tab[816]
#define __pyx_n_u_win874 __pyx_string_tab[817]
#define __pyx_n_u_win932 __pyx_string_tab[818]
#define __pyx_n_u_win936 __pyx_string_tab[819]
#define __pyx_n_u_win949 __pyx_string_tab[820]
#define __pyx_n_u_win950 __pyx_string_tab[821]
#define __pyx_n_u_windows1250 __pyx_string_tab[822]
#define __pyx_n_u_windows1251 __pyx_string_tab[823]
#define __pyx_n_u_windows1252 __pyx_string_tab[824]
#define __pyx_n_u_windows1253 __pyx_string_tab[825]
#define __pyx_n_u_windows1254 __pyx_string_tab[826]
#define __pyx_n_u_windows1255 __pyx_string_tab[827]
#define __pyx_n_u_windows1256 __pyx_string_tab[828]
#define __pyx_n_u_windows1257 __pyx_string_tab[829]
#define __pyx_n_u_windows1258 __pyx_string_tab[830]
#define __pyx_n_u_windows866 __pyx_string_tab[831]
#define __pyx_n_u_windows874 __pyx_string_tab[832]
#define __pyx_n_u_windows932 __pyx_string_tab[833]
#define __pyx_n_u_windows936 __pyx_string_tab[834]
#define __pyx_n_u_windows949 __pyx_string_tab[835]
#define __pyx_n_u_windows950 __pyx_string_tab[836]
#define __pyx_n_u_with_msg __pyx_string_tab[837]
#define __pyx_n_u_write __pyx_string_tab[838]
#define __pyx_n_u_writelines __pyx_string_tab[839]
#define __pyx_n_u_writing_allowed __pyx_string_tab[840]
#define __pyx_n_u_x __pyx_string_tab[841]
#define __pyx_n_u_xformat __pyx_string_tab[842]
#define __pyx_n_u_xid __pyx_string_tab[843]
#define __pyx_n_u_xid8 __pyx_string_tab[844]
#define __pyx_n_u_xml __pyx_string_tab[845]
#define __pyx_n_u_y __pyx_string_tab[846]
#define __pyx_n_u_zip __pyx_string_tab[847]
#define __pyx_kp_b_Client_Key __pyx_string_tab[848]
#define __pyx_kp_b_PGCOPY __pyx_string_tab[849]
#define __pyx_kp_b_PyObject_struct___pyx_obj_7async __pyx_string_tab[850]
#define __pyx_kp_b_SCRAM_SHA_256 __pyx_string_tab[851]
#define __pyx_kp_b_Server_Key __pyx_string_tab[852]
#define __pyx_kp_b__10 __pyx_string_tab[853]
#define __pyx_kp_b__11 __pyx_string_tab[854]
#define __pyx_kp_b__12 __pyx_string_tab[855]
#define __pyx_kp_b__13 __pyx_string_tab[856]
#define __pyx_kp_b__15 __pyx_string_tab[857]
#define __pyx_kp_b_c_2 __pyx_string_tab[858]
#define __pyx_kp_b_c_3 __pyx_string_tab[859]
#define __pyx_kp_b_i_d __pyx_string_tab[860]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[861]
#define __pyx_kp_b_iso88591_1Ja __pyx_string_tab[862]
#define __pyx_kp_b_iso88591_34 __pyx_string_tab[863]
#define __pyx_kp_b_iso88591_6 __pyx_string_tab[864]
#define __pyx_kp_b_iso88591_A __pyx_string_tab[865]
#define __pyx_kp_b_iso88591_A01_AYj_A_q_Q __pyx_string_tab[866]
#define __pyx_kp_b_iso88591_A12_Q_7_Q_q_Qj_Qa_T_A_Ja_z_A_t_Q __pyx_string_tab[867]
#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[868]
#define __pyx_kp_b_iso88591_A_4q_0_L __pyx_string_tab[869]
#define __pyx_kp_b_iso88591_A_4q_Kq_aq_Kq_JfA_M __pyx_string_tab[870]
#define __pyx_kp_b_iso88591_A_4q_wa_4wd_T_q_3j __pyx_string_tab[871]
#define __pyx_kp_b_iso88591_A_4s_q_Qa_fHA_2_D_5_q __pyx_string_tab[872]
#define __pyx_kp_b_iso88591_A_4t1_1_E_Q_1AQ_1A_D_vS_j_4A_4wa __pyx_string_tab[873]
#define __pyx_kp_b_iso88591_A_4xwd_S_S_O7_q_Cq_A_G_a __pyx_string_tab[874]
#define __pyx_kp_b_iso88591_A_4y_1_1_4y __pyx_string_tab[875]
#define __pyx_kp_b_iso88591_A_4y_q_D __pyx_string_tab[876]
#define __pyx_kp_b_iso88591_A_4y_q_D_Rt1 __pyx_string_tab[877]
#define __pyx_kp_b_iso88591_A_7_Q_a_Cq_a_Cq_a_O1_B_M_0_A1_Q __pyx_string_tab[878]
#define __pyx_kp_b_iso88591_A_7_Q_a_a_Cq_a_a_Cq_a_a_O1_B_31 __pyx_string_tab[879]
#define __pyx_kp_b_iso88591_A_87_4q_A_q_j_q_q_t_Qa __pyx_string_tab[880]
#define __pyx_kp_b_iso88591_A_D __pyx_string_tab[881]
#define __pyx_kp_b_iso88591_A_F __pyx_string_tab[882]
#define __pyx_kp_b_iso88591_A_F_AQ_t_Qe_2Qa_Rq_1_1_r_q_1_1_q __pyx_string_tab[883]
#define __pyx_kp_b_iso88591_A_G1_a_D_6_Q __pyx_string_tab[884]
#define __pyx_kp_b_iso88591_A_G4q_D_vS_j_4A_5_U_gU_uAQ __pyx_string_tab[885]
#define __pyx_kp_b_iso88591_A_G_Qa __pyx_string_tab[886]
#define __pyx_kp_b_iso88591_A_IQ __pyx_string_tab[887]
#define __pyx_kp_b_iso88591_A_Ja __pyx_string_tab[888]
#define __pyx_kp_b_iso88591_A_JgT __pyx_string_tab[889]
#define __pyx_kp_b_iso88591_A_Kq_L __pyx_string_tab[890]
#define __pyx_kp_b_iso88591_A_M __pyx_string_tab[891]
#define __pyx_kp_b_iso88591_A_M_1A __pyx_string_tab[892]
#define __pyx_kp_b_iso88591_A_M_Qiz __pyx_string_tab[893]
#define __pyx_kp_b_iso88591_A_M_y_q_E_Q_7_81_hc_q_1F_A_V1_a __pyx_string_tab[894]
#define __pyx_kp_b_iso88591_A_N_Kq __pyx_string_tab[895]
#define __pyx_kp_b_iso88591_A_Q_4q_Q_I_AZq_6_E_D_4q_4q_Q_I_A __pyx_string_tab[896]
#define __pyx_kp_b_iso88591_A_T_q_nA_d_4wa_q_A_A_1_a_4wc_q_K __pyx_string_tab[897]
#define __pyx_kp_b_iso88591_A_q __pyx_string_tab[898]
#define __pyx_kp_b_iso88591_A_q_A_A_q_Q_A_1_1_7_Q_q_q_G1_xs __pyx_string_tab[899]
#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[900]
#define __pyx_kp_b_iso88591_A_t4y_D_Cq __pyx_string_tab[901]
#define __pyx_kp_b_iso88591_A_t_5 __pyx_string_tab[902]
#define __pyx_kp_b_iso88591_A_t_5Q __pyx_string_tab[903]
#define __pyx_kp_b_iso88591_A_we1_G1 __pyx_string_tab[904]
#define __pyx_kp_b_iso88591_A_wgQe4q __pyx_string_tab[905]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[906]
#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[907]
#define __pyx_kp_b_iso88591_QfA __pyx_string_tab[908]
#define __pyx_kp_b_iso88591_T_5T9PPTTiimm_B_B_L_L_P_P_b_b_s __pyx_string_tab[909]
#define __pyx_kp_b_iso88591_T_5T9PPTTiimmww_L_L_P_P_Z_Z_l_l __pyx_string_tab[910]
#define __pyx_kp_b_iso88591_T_t1_G1F_a_vWE_Q_q_t_0_uCtCYY_a __pyx_string_tab[911]
#define __pyx_kp_b_iso88591_Zq __pyx_string_tab[912]
#define __pyx_kp_b_iso88591__26 __pyx_string_tab[913]
#define __pyx_kp_b_iso88591__27 __pyx_string_tab[914]
#define __pyx_kp_b_iso88591__28 __pyx_string_tab[915]
#define __pyx_kp_b_iso88591__29 __pyx_string_tab[916]
#define __pyx_kp_b_iso88591__30 __pyx_string_tab[917]
#define __pyx_kp_b_iso88591_a __pyx_string_tab[918]
#define __pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1 __pyx_string_tab[919]
#define __pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1 __pyx_string_tab[920]
#define __pyx_kp_b_iso88591_xs_q_A_q_U_A_l_83aq_U_3aq_uAQ_Q __pyx_string_tab[921]
#define __pyx_kp_b_n __pyx_string_tab[922]
#define __pyx_kp_b_n_2 __pyx_string_tab[923]
#define __pyx_kp_b_p __pyx_string_tab[924]
#define __pyx_kp_b_r_2 __pyx_string_tab[925]
#define __pyx_kp_b_r_3 __pyx_string_tab[926]
#define __pyx_kp_b_s __pyx_string_tab[927]
#define __pyx_kp_b_v __pyx_string_tab[928]
#define __pyx_n_b_NULL __pyx_string_tab[929]
#define __pyx_n_b_c __pyx_string_tab[930]
#define __pyx_n_b_client_encoding __pyx_string_tab[931]
#define __pyx_n_b_d __pyx_string_tab[932]
#define __pyx_n_b_e __pyx_string_tab[933]
#define __pyx_n_b_m __pyx_string_tab[934]
#define __pyx_n_b_md5 __pyx_string_tab[935]
#define __pyx_n_b_r __pyx_string_tab[936]
#define __pyx_int_0 __pyx_number_tab[0]
#define __pyx_int_1 __pyx_number_tab[1]
#define __pyx_int_4 __pyx_number_tab[2]
#define __pyx_int_6 __pyx_number_tab[3]
#define __pyx_int_16 __pyx_number_tab[4]
#define __pyx_int_17 __pyx_number_tab[5]
#define __pyx_int_18 __pyx_number_tab[6]
#define __pyx_int_19 __pyx_number_tab[7]
#define __pyx_int_20 __pyx_number_tab[8]
#define __pyx_int_21 __pyx_number_tab[9]
#define __pyx_int_23 __pyx_number_tab[10]
#define __pyx_int_24 __pyx_number_tab[11]
#define __pyx_int_25 __pyx_number_tab[12]
#define __pyx_int_26 __pyx_number_tab[13]
#define __pyx_int_27 __pyx_number_tab[14]
#define __pyx_int_28 __pyx_number_tab[15]
#define __pyx_int_29 __pyx_number_tab[16]
#define __pyx_int_32 __pyx_number_tab[17]
#define __pyx_int_114 __pyx_number_tab[18]
#define __pyx_int_142 __pyx_number_tab[19]
#define __pyx_int_194 __pyx_number_tab[20]
#define __pyx_int_210 __pyx_number_tab[21]
#define __pyx_int_269 __pyx_number_tab[22]
#define __pyx_int_325 __pyx_number_tab[23]
#define __pyx_int_600 __pyx_number_tab[24]
#define __pyx_int_601 __pyx_number_tab[25]
#define __pyx_int_602 __pyx_number_tab[26]
#define __pyx_int_603 __pyx_number_tab[27]
#define __pyx_int_604 __pyx_number_tab[28]
#define __pyx_int_628 __pyx_number_tab[29]
#define __pyx_int_650 __pyx_number_tab[30]
#define __pyx_int_700 __pyx_number_tab[31]
#define __pyx_int_701 __pyx_number_tab[32]
#define __pyx_int_702 __pyx_number_tab[33]
#define __pyx_int_703 __pyx_number_tab[34]
#define __pyx_int_704 __pyx_number_tab[35]
#define __pyx_int_705 __pyx_number_tab[36]
#define __pyx_int_718 __pyx_number_tab[37]
#define __pyx_int_774 __pyx_number_tab[38]
#define __pyx_int_790 __pyx_number_tab[39]
#define __pyx_int_829 __pyx_number_tab[40]
#define __pyx_int_869 __pyx_number_tab[41]
#define __pyx_int_1009 __pyx_number_tab[42]
#define __pyx_int_1028 __pyx_number_tab[43]
#define __pyx_int_1033 __pyx_number_tab[44]
#define __pyx_int_1042 __pyx_number_tab[45]
#define __pyx_int_1043 __pyx_number_tab[46]
#define __pyx_int_1082 __pyx_number_tab[47]
#define __pyx_int_1083 __pyx_number_tab[48]
#define __pyx_int_1114 __pyx_number_tab[49]
#define __pyx_int_1184 __pyx_number_tab[50]
#define __pyx_int_1186 __pyx_number_tab[51]
#define __pyx_int_1266 __pyx_number_tab[52]
#define __pyx_int_1560 __pyx_number_tab[53]
#define __pyx_int_1562 __pyx_number_tab[54]
#define __pyx_int_1700 __pyx_number_tab[55]
#define __pyx_int_1790 __pyx_number_tab[56]
#define __pyx_int_2202 __pyx_number_tab[57]
#define __pyx_int_2203 __pyx_number_tab[58]
#define __pyx_int_2204 __pyx_number_tab[59]
#define __pyx_int_2205 __pyx_number_tab[60]
#define __pyx_int_2206 __pyx_number_tab[61]
#define __pyx_int_2249 __pyx_number_tab[62]
#define __pyx_int_2275 __pyx_number_tab[63]
#define __pyx_int_2276 __pyx_number_tab[64]
#define __pyx_int_2277 __pyx_number_tab[65]
#define __pyx_int_2278 __pyx_number_tab[66]
#define __pyx_int_2279 __pyx_number_tab[67]
#define __pyx_int_2280 __pyx_number_tab[68]
#define __pyx_int_2281 __pyx_number_tab[69]
#define __pyx_int_2282 __pyx_number_tab[70]
#define __pyx_int_2283 __pyx_number_tab[71]
#define __pyx_int_2776 __pyx_number_tab[72]
#define __pyx_int_2950 __pyx_number_tab[73]
#define __pyx_int_2970 __pyx_number_tab[74]
#define __pyx_int_3115 __pyx_number_tab[75]
#define __pyx_int_3220 __pyx_number_tab[76]
#define __pyx_int_3310 __pyx_number_tab[77]
#define __pyx_int_3361 __pyx_number_tab[78]
#define __pyx_int_3402 __pyx_number_tab[79]
#define __pyx_int_3500 __pyx_number_tab[80]
#define __pyx_int_3614 __pyx_number_tab[81]
#define __pyx_int_3615 __pyx_number_tab[82]
#define __pyx_int_3642 __pyx_number_tab[83]
#define __pyx_int_3734 __pyx_number_tab[84]
#define __pyx_int_3769 __pyx_number_tab[85]
#define __pyx_int_3802 __pyx_number_tab[86]
#define __pyx_int_3831 __pyx_number_tab[87]
#define __pyx_int_3838 __pyx_number_tab[88]
#define __pyx_int_4072 __pyx_number_tab[89]
#define __pyx_int_4089 __pyx_number_tab[90]
#define __pyx_int_4096 __pyx_number_tab[91]
#define __pyx_int_4191 __pyx_number_tab[92]
#define __pyx_int_4537 __pyx_number_tab[93]
#define __pyx_int_4538 __pyx_number_tab[94]
#define __pyx_int_4600 __pyx_number_tab[95]
#define __pyx_int_4601 __pyx_number_tab[96]
#define __pyx_int_5017 __pyx_number_tab[97]
#define __pyx_int_5038 __pyx_number_tab[98]
#define __pyx_int_5069 __pyx_number_tab[99]
#define __pyx_int_5077 __pyx_number_tab[100]
#define __pyx_int_5078 __pyx_number_tab[101]
#define __pyx_int_5079 __pyx_number_tab[102]
#define __pyx_int_5080 __pyx_number_tab[103]
#define __pyx_int_32768 __pyx_number_tab[104]
#define __pyx_int_524288 __pyx_number_tab[105]
#define __pyx_int_134522893 __pyx_number_tab[106]
#define __pyx_int_175807176 __pyx_number_tab[107]
#define __pyx_int_228230485 __pyx_number_tab[108]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CodecMap);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_Codec);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close);
  Py_CLEAR(clear_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation);
  Py_CLEAR(clear_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation);
  Py_CLEAR(clear_module_state->__pyx_k__4);
  Py_CLEAR(clear_module_state->__pyx_k__5);
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<86; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<937; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<109; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* Coroutine.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CoroutineType);
Py_CLEAR(clear_module_state->__pyx_CoroutineAwaitType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* Generator.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CodecMap);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_Codec);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close);
  Py_VISIT(traverse_module_state->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation);
  Py_VISIT(traverse_module_state->__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation);
  Py_VISIT(traverse_module_state->__pyx_k__4);
  Py_VISIT(traverse_module_state->__pyx_k__5);
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<86; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<937; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<109; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* Coroutine.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CoroutineType);
Py_VISIT(traverse_module_state->__pyx_CoroutineAwaitType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* Generator.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":29
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
*/
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":121
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":122
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 122, __pyx_L1_error)

  /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":125
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
*/
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":123
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
*/
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":128
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":129
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
*/
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":130
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":140
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
*/
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":141
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
*/
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 141, __pyx_L1_error)

  /* "cpython/contextvars.pxd":143
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":144
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
*/
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":145
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "asyncpg/pgproto/frb.pxd":14
 *         ssize_t len
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         return frb.len
 * 
*/

static CYTHON_INLINE Py_ssize_t __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) {
  Py_ssize_t __pyx_r;

  /* "asyncpg/pgproto/frb.pxd":15
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):
 *         return frb.len             # <<<<<<<<<<<<<<
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):
*/
  __pyx_r = __pyx_v_frb->len;
  goto __pyx_L0;

  /* "asyncpg/pgproto/frb.pxd":14
 *         ssize_t len
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         return frb.len
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/pgproto/frb.pxd":17
 *         return frb.len
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):             # <<<<<<<<<<<<<<
 *         frb.len = new_len
 * 
*/

static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_new_len) {

  /* "asyncpg/pgproto/frb.pxd":18
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):
 *         frb.len = new_len             # <<<<<<<<<<<<<<
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
*/
  __pyx_v_frb->len = __pyx_v_new_len;

  /* "asyncpg/pgproto/frb.pxd":17
 *         return frb.len
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):             # <<<<<<<<<<<<<<
 *         frb.len = new_len
 * 
*/

  /* function exit code */
}

/* "asyncpg/pgproto/frb.pxd":20
 *         frb.len = new_len
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):             # <<<<<<<<<<<<<<
 *         frb.buf = buf
 *         frb.len = len
*/

static CYTHON_INLINE void __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, char const *__pyx_v_buf, Py_ssize_t __pyx_v_len) {

  /* "asyncpg/pgproto/frb.pxd":21
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
 *         frb.buf = buf             # <<<<<<<<<<<<<<
 *         frb.len = len
 * 
*/
  __pyx_v_frb->buf = __pyx_v_buf;

  /* "asyncpg/pgproto/frb.pxd":22
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
 *         frb.buf = buf
 *         frb.len = len             # <<<<<<<<<<<<<<
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:
*/
  __pyx_v_frb->len = __pyx_v_len;

  /* "asyncpg/pgproto/frb.pxd":20
 *         frb.len = new_len
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):             # <<<<<<<<<<<<<<
 *         frb.buf = buf
 *         frb.len = len
*/

  /* function exit code */
}

/* "asyncpg/pgproto/frb.pxd":24
 *         frb.len = len
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:             # <<<<<<<<<<<<<<
 *         cdef const char *result
 * 
*/

static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_n) {
  char const *__pyx_v_result;
  char const *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frb_read", 0);

  /* "asyncpg/pgproto/frb.pxd":27
 *         cdef const char *result
 * 
 *         frb_check(frb, n)             # <<<<<<<<<<<<<<
 * 
 *         result = frb.buf
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check(__pyx_v_frb, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/pgproto/frb.pxd":29
 *         frb_check(frb, n)
 * 
 *         result = frb.buf             # <<<<<<<<<<<<<<
 *         frb.buf += n
 *         frb.len -= n
*/
  __pyx_t_2 = __pyx_v_frb->buf;
  __pyx_v_result = __pyx_t_2;

  /* "asyncpg/pgproto/frb.pxd":30
 * 
 *         result = frb.buf
 *         frb.buf += n             # <<<<<<<<<<<<<<
 *         frb.len -= n
 * 
*/
  __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_n);

  /* "asyncpg/pgproto/frb.pxd":31
 *         result = frb.buf
 *         frb.buf += n
 *         frb.len -= n             # <<<<<<<<<<<<<<
 * 
 *         return result
*/
  __pyx_v_frb->len = (__pyx_v_frb->len - __pyx_v_n);

  /* "asyncpg/pgproto/frb.pxd":33
 *         frb.len -= n
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/pgproto/frb.pxd":24
 *         frb.len = len
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:             # <<<<<<<<<<<<<<
 *         cdef const char *result
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/pgproto/frb.pxd":35
 *         return result
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         cdef const char *result
 *         result = frb.buf
*/

static CYTHON_INLINE char const *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_read_all(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) {
  char const *__pyx_v_result;
  char const *__pyx_r;
  char const *__pyx_t_1;

  /* "asyncpg/pgproto/frb.pxd":37
 *     inline const char* frb_read_all(FRBuffer *frb):
 *         cdef const char *result
 *         result = frb.buf             # <<<<<<<<<<<<<<
 *         frb.buf += frb.len
 *         frb.len = 0
*/
  __pyx_t_1 = __pyx_v_frb->buf;
  __pyx_v_result = __pyx_t_1;

  /* "asyncpg/pgproto/frb.pxd":38
 *         cdef const char *result
 *         result = frb.buf
 *         frb.buf += frb.len             # <<<<<<<<<<<<<<
 *         frb.len = 0
 *         return result
*/
  __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_frb->len);

  /* "asyncpg/pgproto/frb.pxd":39
 *         result = frb.buf
 *         frb.buf += frb.len
 *         frb.len = 0             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_frb->len = 0;

  /* "asyncpg/pgproto/frb.pxd":40
 *         frb.buf += frb.len
 *         frb.len = 0
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/pgproto/frb.pxd":35
 *         return result
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         cdef const char *result
 *         result = frb.buf
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/pgproto/frb.pxd":42
 *         return result
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,             # <<<<<<<<<<<<<<
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
*/

static CYTHON_INLINE struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len) {
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_r;
  char const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "asyncpg/pgproto/frb.pxd":44
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)             # <<<<<<<<<<<<<<
 *         frb.len = len
 *         return frb
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_source, __pyx_v_len); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(5, 44, __pyx_L1_error)
  __pyx_v_frb->buf = __pyx_t_1;

  /* "asyncpg/pgproto/frb.pxd":45
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
 *         frb.len = len             # <<<<<<<<<<<<<<
 *         return frb
 * 
*/
  __pyx_v_frb->len = __pyx_v_len;

  /* "asyncpg/pgproto/frb.pxd":46
 *         frb.buf = frb_read(source, len)
 *         frb.len = len
 *         return frb             # <<<<<<<<<<<<<<
 * 
 *     object frb_check(FRBuffer *frb, ssize_t n)
*/
  __pyx_r = __pyx_v_frb;
  goto __pyx_L0;

  /* "asyncpg/pgproto/frb.pxd":42
 *         return result
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,             # <<<<<<<<<<<<<<
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.pgproto.pgproto.frb_slice_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/pgproto/buffer.pxd":35
 *         bint _message_mode
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
*/

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

  /* "asyncpg/pgproto/buffer.pxd":36
 * 
 *     cdef inline len(self):
 *         return self._length             # <<<<<<<<<<<<<<
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/pgproto/buffer.pxd":35
 *         bint _message_mode
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
*/

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

/* "asyncpg/pgproto/buffer.pxd":38
 *         return self._length
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):             # <<<<<<<<<<<<<<
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_len_prefixed_utf8", 0);

  /* "asyncpg/pgproto/buffer.pxd":39
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_readonly(self)
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_s == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
    __PYX_ERR(6, 39, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self->__pyx_vtab)->write_len_prefixed_bytes(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asyncpg/pgproto/buffer.pxd":38
 *         return self._length
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):             # <<<<<<<<<<<<<<
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.pgproto.pgproto.WriteBuffer.write_len_prefixed_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/pgproto/buffer.pxd":107
 *         bint _current_message_ready
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
*/

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

  /* "asyncpg/pgproto/buffer.pxd":108
 * 
 *     cdef inline len(self):
 *         return self._length             # <<<<<<<<<<<<<<
 * 
 *     cdef inline char get_message_type(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/pgproto/buffer.pxd":107
 *         bint _current_message_ready
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
*/

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

/* "asyncpg/pgproto/buffer.pxd":110
 *         return self._length
 * 
 *     cdef inline char get_message_type(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_type
 * 
*/

static CYTHON_INLINE char __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) {
  char __pyx_r;

  /* "asyncpg/pgproto/buffer.pxd":111
 * 
 *     cdef inline char get_message_type(self):
 *         return self._current_message_type             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int32_t get_message_length(self):
*/
  __pyx_r = __pyx_v_self->_current_message_type;
  goto __pyx_L0;

  /* "asyncpg/pgproto/buffer.pxd":110
 *         return self._length
 * 
 *     cdef inline char get_message_type(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_type
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/pgproto/buffer.pxd":113
 *         return self._current_message_type
 * 
 *     cdef inline int32_t get_message_length(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_len
 * 
*/

static CYTHON_INLINE int32_t __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) {
  int32_t __pyx_r;

  /* "asyncpg/pgproto/buffer.pxd":114
 * 
 *     cdef inline int32_t get_message_length(self):
 *         return self._current_message_len             # <<<<<<<<<<<<<<
 * 
 *     cdef feed_data(self, data)
*/
  __pyx_r = __pyx_v_self->_current_message_len;
  goto __pyx_L0;

  /* "asyncpg/pgproto/buffer.pxd":113
 *         return self._current_message_type
 * 
 *     cdef inline int32_t get_message_length(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_len
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/encodings.pyx":62
 * 
 * 
 * cdef get_python_encoding(pg_encoding):             # <<<<<<<<<<<<<<
 *     return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower())
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(PyObject *__pyx_v_pg_encoding) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_python_encoding", 0);

  /* "asyncpg/protocol/encodings.pyx":63
 * 
 * cdef get_python_encoding(pg_encoding):
 *     return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower())             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ENCODINGS_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_v_pg_encoding;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_7 = __pyx_v_pg_encoding;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/encodings.pyx":62
 * 
 * 
 * cdef get_python_encoding(pg_encoding):             # <<<<<<<<<<<<<<
 *     return ENCODINGS_MAP.get(pg_encoding.lower(), pg_encoding.lower())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.get_python_encoding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":14
 * cdef class ConnectionSettings(pgproto.CodecContext):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._encoding = 'utf-8'
 *         self._is_utf8 = True
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/settings.pyx":15
 * 
 *     def __cinit__(self):
 *         self._encoding = 'utf-8'             # <<<<<<<<<<<<<<
 *         self._is_utf8 = True
 *         self._settings = {}
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
  __Pyx_GOTREF(__pyx_v_self->_encoding);
  __Pyx_DECREF(__pyx_v_self->_encoding);
  __pyx_v_self->_encoding = __pyx_mstate_global->__pyx_kp_u_utf_8;

  /* "asyncpg/protocol/settings.pyx":16
 *     def __cinit__(self):
 *         self._encoding = 'utf-8'
 *         self._is_utf8 = True             # <<<<<<<<<<<<<<
 *         self._settings = {}
 *         self._codec = codecs.lookup('utf-8')
*/
  __pyx_v_self->_is_utf8 = 1;

  /* "asyncpg/protocol/settings.pyx":17
 *         self._encoding = 'utf-8'
 *         self._is_utf8 = True
 *         self._settings = {}             # <<<<<<<<<<<<<<
 *         self._codec = codecs.lookup('utf-8')
 *         self._data_codecs = DataCodecConfig()
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_settings);
  __Pyx_DECREF(__pyx_v_self->_settings);
  __pyx_v_self->_settings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":18
 *         self._is_utf8 = True
 *         self._settings = {}
 *         self._codec = codecs.lookup('utf-8')             # <<<<<<<<<<<<<<
 *         self._data_codecs = DataCodecConfig()
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_codecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_codec);
  __Pyx_DECREF(__pyx_v_self->_codec);
  __pyx_v_self->_codec = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":19
 *         self._settings = {}
 *         self._codec = codecs.lookup('utf-8')
 *         self._data_codecs = DataCodecConfig()             # <<<<<<<<<<<<<<
 * 
 *     cdef add_setting(self, str name, str val):
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 19, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_data_codecs);
  __pyx_v_self->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":14
 * cdef class ConnectionSettings(pgproto.CodecContext):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._encoding = 'utf-8'
 *         self._is_utf8 = True
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":21
 *         self._data_codecs = DataCodecConfig()
 * 
 *     cdef add_setting(self, str name, str val):             # <<<<<<<<<<<<<<
 *         self._settings[name] = val
 *         if name == 'client_encoding':
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) {
  PyObject *__pyx_v_py_enc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_setting", 0);

  /* "asyncpg/protocol/settings.pyx":22
 * 
 *     cdef add_setting(self, str name, str val):
 *         self._settings[name] = val             # <<<<<<<<<<<<<<
 *         if name == 'client_encoding':
 *             py_enc = get_python_encoding(val)
*/
  if (unlikely(__pyx_v_self->_settings == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(8, 22, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_self->_settings, __pyx_v_name, __pyx_v_val) < 0))) __PYX_ERR(8, 22, __pyx_L1_error)

  /* "asyncpg/protocol/settings.pyx":23
 *     cdef add_setting(self, str name, str val):
 *         self._settings[name] = val
 *         if name == 'client_encoding':             # <<<<<<<<<<<<<<
 *             py_enc = get_python_encoding(val)
 *             self._codec = codecs.lookup(py_enc)
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_mstate_global->__pyx_n_u_client_encoding, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 23, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asyncpg/protocol/settings.pyx":24
 *         self._settings[name] = val
 *         if name == 'client_encoding':
 *             py_enc = get_python_encoding(val)             # <<<<<<<<<<<<<<
 *             self._codec = codecs.lookup(py_enc)
 *             self._encoding = self._codec.name
*/
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_get_python_encoding(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 24, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_py_enc = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/settings.pyx":25
 *         if name == 'client_encoding':
 *             py_enc = get_python_encoding(val)
 *             self._codec = codecs.lookup(py_enc)             # <<<<<<<<<<<<<<
 *             self._encoding = self._codec.name
 *             self._is_utf8 = self._encoding == 'utf-8'
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_codecs); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lookup); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_py_enc};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_codec);
    __Pyx_DECREF(__pyx_v_self->_codec);
    __pyx_v_self->_codec = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/settings.pyx":26
 *             py_enc = get_python_encoding(val)
 *             self._codec = codecs.lookup(py_enc)
 *             self._encoding = self._codec.name             # <<<<<<<<<<<<<<
 *             self._is_utf8 = self._encoding == 'utf-8'
 * 
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_codec, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(8, 26, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_encoding);
    __Pyx_DECREF(__pyx_v_self->_encoding);
    __pyx_v_self->_encoding = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/settings.pyx":27
 *             self._codec = codecs.lookup(py_enc)
 *             self._encoding = self._codec.name
 *             self._is_utf8 = self._encoding == 'utf-8'             # <<<<<<<<<<<<<<
 * 
 *     cdef is_encoding_utf8(self):
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->_encoding, __pyx_mstate_global->__pyx_kp_u_utf_8, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 27, __pyx_L1_error)
    __pyx_v_self->_is_utf8 = __pyx_t_1;

    /* "asyncpg/protocol/settings.pyx":23
 *     cdef add_setting(self, str name, str val):
 *         self._settings[name] = val
 *         if name == 'client_encoding':             # <<<<<<<<<<<<<<
 *             py_enc = get_python_encoding(val)
 *             self._codec = codecs.lookup(py_enc)
*/
  }

  /* "asyncpg/protocol/settings.pyx":21
 *         self._data_codecs = DataCodecConfig()
 * 
 *     cdef add_setting(self, str name, str val):             # <<<<<<<<<<<<<<
 *         self._settings[name] = val
 *         if name == 'client_encoding':
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_setting", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_enc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":29
 *             self._is_utf8 = self._encoding == 'utf-8'
 * 
 *     cdef is_encoding_utf8(self):             # <<<<<<<<<<<<<<
 *         return self._is_utf8
 * 
*/

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

  /* "asyncpg/protocol/settings.pyx":30
 * 
 *     cdef is_encoding_utf8(self):
 *         return self._is_utf8             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_utf8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/settings.pyx":29
 *             self._is_utf8 = self._encoding == 'utf-8'
 * 
 *     cdef is_encoding_utf8(self):             # <<<<<<<<<<<<<<
 *         return self._is_utf8
 * 
*/

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

/* "asyncpg/protocol/settings.pyx":32
 *         return self._is_utf8
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_text_codec", 0);

  /* "asyncpg/protocol/settings.pyx":33
 * 
 *     cpdef get_text_codec(self):
 *         return self._codec             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline register_data_types(self, types):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_codec);
  __pyx_r = __pyx_v_self->_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/settings.pyx":32
 *         return self._is_utf8
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec = {"get_text_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_text_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_text_codec", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_text_codec", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_2get_text_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_text_codec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_text_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":35
 *         return self._codec
 * 
 *     cpdef inline register_data_types(self, types):             # <<<<<<<<<<<<<<
 *         self._data_codecs.add_types(types)
 * 
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_data_types", 0);

  /* "asyncpg/protocol/settings.pyx":36
 * 
 *     cpdef inline register_data_types(self, types):
 *         self._data_codecs.add_types(types)             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline add_python_codec(self, typeoid, typename, typeschema,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_types};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_types, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":35
 *         return self._codec
 * 
 *     cpdef inline register_data_types(self, types):             # <<<<<<<<<<<<<<
 *         self._data_codecs.add_types(types)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types = {"register_data_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_types = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register_data_types (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_types,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(8, 35, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "register_data_types", 0) < (0)) __PYX_ERR(8, 35, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("register_data_types", 1, 1, 1, i); __PYX_ERR(8, 35, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 35, __pyx_L3_error)
    }
    __pyx_v_types = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register_data_types", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 35, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_types);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_4register_data_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_types) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_data_types", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types(__pyx_v_self, __pyx_v_types, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.register_data_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":38
 *         self._data_codecs.add_types(types)
 * 
 *     cpdef inline add_python_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                   typeinfos, typekind, encoder, decoder,
 *                                   format):
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v__format;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_python_codec", 0);

  /* "asyncpg/protocol/settings.pyx":45
 *             ClientExchangeFormat xformat
 * 
 *         if format == 'binary':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_BINARY
 *             xformat = PG_XFORMAT_OBJECT
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_mstate_global->__pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 45, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asyncpg/protocol/settings.pyx":46
 * 
 *         if format == 'binary':
 *             _format = PG_FORMAT_BINARY             # <<<<<<<<<<<<<<
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'text':
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY;

    /* "asyncpg/protocol/settings.pyx":47
 *         if format == 'binary':
 *             _format = PG_FORMAT_BINARY
 *             xformat = PG_XFORMAT_OBJECT             # <<<<<<<<<<<<<<
 *         elif format == 'text':
 *             _format = PG_FORMAT_TEXT
*/
    __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT;

    /* "asyncpg/protocol/settings.pyx":45
 *             ClientExchangeFormat xformat
 * 
 *         if format == 'binary':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_BINARY
 *             xformat = PG_XFORMAT_OBJECT
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":48
 *             _format = PG_FORMAT_BINARY
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'text':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_TEXT
 *             xformat = PG_XFORMAT_OBJECT
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_mstate_global->__pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 48, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asyncpg/protocol/settings.pyx":49
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'text':
 *             _format = PG_FORMAT_TEXT             # <<<<<<<<<<<<<<
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'tuple':
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT;

    /* "asyncpg/protocol/settings.pyx":50
 *         elif format == 'text':
 *             _format = PG_FORMAT_TEXT
 *             xformat = PG_XFORMAT_OBJECT             # <<<<<<<<<<<<<<
 *         elif format == 'tuple':
 *             _format = PG_FORMAT_ANY
*/
    __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT;

    /* "asyncpg/protocol/settings.pyx":48
 *             _format = PG_FORMAT_BINARY
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'text':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_TEXT
 *             xformat = PG_XFORMAT_OBJECT
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":51
 *             _format = PG_FORMAT_TEXT
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'tuple':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_ANY
 *             xformat = PG_XFORMAT_TUPLE
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_mstate_global->__pyx_n_u_tuple, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 51, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "asyncpg/protocol/settings.pyx":52
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'tuple':
 *             _format = PG_FORMAT_ANY             # <<<<<<<<<<<<<<
 *             xformat = PG_XFORMAT_TUPLE
 *         else:
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY;

    /* "asyncpg/protocol/settings.pyx":53
 *         elif format == 'tuple':
 *             _format = PG_FORMAT_ANY
 *             xformat = PG_XFORMAT_TUPLE             # <<<<<<<<<<<<<<
 *         else:
 *             raise exceptions.InterfaceError(
*/
    __pyx_v_xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;

    /* "asyncpg/protocol/settings.pyx":51
 *             _format = PG_FORMAT_TEXT
 *             xformat = PG_XFORMAT_OBJECT
 *         elif format == 'tuple':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_ANY
 *             xformat = PG_XFORMAT_TUPLE
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":55
 *             xformat = PG_XFORMAT_TUPLE
 *         else:
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'invalid `format` argument, expected {}, got {!r}'.format(
 *                     "'text', 'binary' or 'tuple'", format
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/settings.pyx":56
 *         else:
 *             raise exceptions.InterfaceError(
 *                 'invalid `format` argument, expected {}, got {!r}'.format(             # <<<<<<<<<<<<<<
 *                     "'text', 'binary' or 'tuple'", format
 *                 ))
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_invalid_format_argument_expected;
    __Pyx_INCREF(__pyx_t_6);

    /* "asyncpg/protocol/settings.pyx":57
 *             raise exceptions.InterfaceError(
 *                 'invalid `format` argument, expected {}, got {!r}'.format(
 *                     "'text', 'binary' or 'tuple'", format             # <<<<<<<<<<<<<<
 *                 ))
 * 
*/
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_text_binary_or_tuple, __pyx_v_format};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(8, 55, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "asyncpg/protocol/settings.pyx":60
 *                 ))
 * 
 *         self._data_codecs.add_python_codec(typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                            typekind, typeinfos,
 *                                            encoder, decoder,
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_INCREF(__pyx_t_5);

  /* "asyncpg/protocol/settings.pyx":63
 *                                            typekind, typeinfos,
 *                                            encoder, decoder,
 *                                            _format, xformat)             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline remove_python_codec(self, typeoid, typename, typeschema):
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[10] = {__pyx_t_5, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_typeinfos, __pyx_v_encoder, __pyx_v_decoder, __pyx_t_4, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_callargs+__pyx_t_7, (10-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/settings.pyx":38
 *         self._data_codecs.add_types(types)
 * 
 *     cpdef inline add_python_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                   typeinfos, typekind, encoder, decoder,
 *                                   format):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec = {"add_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  PyObject *__pyx_v_typeinfos = 0;
  PyObject *__pyx_v_typekind = 0;
  PyObject *__pyx_v_encoder = 0;
  PyObject *__pyx_v_decoder = 0;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typeinfos,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_encoder,&__pyx_mstate_global->__pyx_n_u_decoder,&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(8, 38, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 38, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_python_codec", 0) < (0)) __PYX_ERR(8, 38, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 8; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, i); __PYX_ERR(8, 38, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(8, 38, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(8, 38, __pyx_L3_error)
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
    __pyx_v_typeinfos = values[3];
    __pyx_v_typekind = values[4];
    __pyx_v_encoder = values[5];
    __pyx_v_decoder = values[6];
    __pyx_v_format = values[7];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 8, 8, __pyx_nargs); __PYX_ERR(8, 38, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typeinfos, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_6add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_typekind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_python_codec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typeinfos, __pyx_v_typekind, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":65
 *                                            _format, xformat)
 * 
 *     cpdef inline remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_python_codec", 0);

  /* "asyncpg/protocol/settings.pyx":66
 * 
 *     cpdef inline remove_python_codec(self, typeoid, typename, typeschema):
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline clear_type_cache(self):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":65
 *                                            _format, xformat)
 * 
 *     cpdef inline remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec = {"remove_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(8, 65, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove_python_codec", 0) < (0)) __PYX_ERR(8, 65, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, i); __PYX_ERR(8, 65, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 65, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 65, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 65, __pyx_L3_error)
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(8, 65, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_8remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_python_codec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":68
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
 *     cpdef inline clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._data_codecs.clear_type_cache()
 * 
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear_type_cache", 0);

  /* "asyncpg/protocol/settings.pyx":69
 * 
 *     cpdef inline clear_type_cache(self):
 *         self._data_codecs.clear_type_cache()             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema,
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/settings.pyx":68
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
 *     cpdef inline clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._data_codecs.clear_type_cache()
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache = {"clear_type_cache", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_type_cache (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear_type_cache", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clear_type_cache", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_10clear_type_cache(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear_type_cache", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":71
 *         self._data_codecs.clear_type_cache()
 * 
 *     cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                         typekind, alias_to, format):
 *         cdef:
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format, CYTHON_UNUSED int __pyx_skip_dispatch) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v__format;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_builtin_type_codec", 0);

  /* "asyncpg/protocol/settings.pyx":76
 *             ServerDataFormat _format
 * 
 *         if format is None:             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_ANY
 *         elif format == 'binary':
*/
  __pyx_t_1 = (__pyx_v_format == Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/settings.pyx":77
 * 
 *         if format is None:
 *             _format = PG_FORMAT_ANY             # <<<<<<<<<<<<<<
 *         elif format == 'binary':
 *             _format = PG_FORMAT_BINARY
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY;

    /* "asyncpg/protocol/settings.pyx":76
 *             ServerDataFormat _format
 * 
 *         if format is None:             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_ANY
 *         elif format == 'binary':
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":78
 *         if format is None:
 *             _format = PG_FORMAT_ANY
 *         elif format == 'binary':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_BINARY
 *         elif format == 'text':
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_mstate_global->__pyx_n_u_binary, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 78, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asyncpg/protocol/settings.pyx":79
 *             _format = PG_FORMAT_ANY
 *         elif format == 'binary':
 *             _format = PG_FORMAT_BINARY             # <<<<<<<<<<<<<<
 *         elif format == 'text':
 *             _format = PG_FORMAT_TEXT
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY;

    /* "asyncpg/protocol/settings.pyx":78
 *         if format is None:
 *             _format = PG_FORMAT_ANY
 *         elif format == 'binary':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_BINARY
 *         elif format == 'text':
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":80
 *         elif format == 'binary':
 *             _format = PG_FORMAT_BINARY
 *         elif format == 'text':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_TEXT
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_mstate_global->__pyx_n_u_text, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 80, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "asyncpg/protocol/settings.pyx":81
 *             _format = PG_FORMAT_BINARY
 *         elif format == 'text':
 *             _format = PG_FORMAT_TEXT             # <<<<<<<<<<<<<<
 *         else:
 *             raise exceptions.InterfaceError(
*/
    __pyx_v__format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT;

    /* "asyncpg/protocol/settings.pyx":80
 *         elif format == 'binary':
 *             _format = PG_FORMAT_BINARY
 *         elif format == 'text':             # <<<<<<<<<<<<<<
 *             _format = PG_FORMAT_TEXT
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/settings.pyx":83
 *             _format = PG_FORMAT_TEXT
 *         else:
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'invalid `format` argument, expected {}, got {!r}'.format(
 *                     "'text' or 'binary'", format
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/settings.pyx":84
 *         else:
 *             raise exceptions.InterfaceError(
 *                 'invalid `format` argument, expected {}, got {!r}'.format(             # <<<<<<<<<<<<<<
 *                     "'text' or 'binary'", format
 *                 ))
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_invalid_format_argument_expected;
    __Pyx_INCREF(__pyx_t_6);

    /* "asyncpg/protocol/settings.pyx":85
 *             raise exceptions.InterfaceError(
 *                 'invalid `format` argument, expected {}, got {!r}'.format(
 *                     "'text' or 'binary'", format             # <<<<<<<<<<<<<<
 *                 ))
 * 
*/
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_text_or_binary, __pyx_v_format};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(8, 83, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "asyncpg/protocol/settings.pyx":88
 *                 ))
 * 
 *         self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                                  typekind, alias_to, _format)
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self->_data_codecs);
  __Pyx_INCREF(__pyx_t_5);

  /* "asyncpg/protocol/settings.pyx":89
 * 
 *         self._data_codecs.set_builtin_type_codec(typeoid, typename, typeschema,
 *                                                  typekind, alias_to, _format)             # <<<<<<<<<<<<<<
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v__format); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_callargs+__pyx_t_7, (7-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/settings.pyx":71
 *         self._data_codecs.clear_type_cache()
 * 
 *     cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                         typekind, alias_to, format):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec = {"set_builtin_type_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  PyObject *__pyx_v_typekind = 0;
  PyObject *__pyx_v_alias_to = 0;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(8, 71, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 71, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_builtin_type_codec", 0) < (0)) __PYX_ERR(8, 71, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, i); __PYX_ERR(8, 71, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 71, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 71, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 71, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(8, 71, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(8, 71, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(8, 71, __pyx_L3_error)
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
    __pyx_v_typekind = values[3];
    __pyx_v_alias_to = values[4];
    __pyx_v_format = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 1, 6, 6, __pyx_nargs); __PYX_ERR(8, 71, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_12set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_builtin_type_codec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec(__pyx_v_self, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":91
 *                                                  typekind, alias_to, _format)
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,             # <<<<<<<<<<<<<<
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format = __pyx_mstate_global->__pyx_k_;

  /* "asyncpg/protocol/settings.pyx":93
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):             # <<<<<<<<<<<<<<
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
 * 
*/
  int __pyx_v_ignore_custom_codec = ((int)0);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_format = __pyx_optional_args->format;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_ignore_custom_codec = __pyx_optional_args->ignore_custom_codec;
      }
    }
  }

  /* "asyncpg/protocol/settings.pyx":94
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, name):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.ignore_custom_codec = __pyx_v_ignore_custom_codec;
  __pyx_t_1 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self->_data_codecs, __pyx_v_oid, __pyx_v_format, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/settings.pyx":91
 *                                                  typekind, alias_to, _format)
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,             # <<<<<<<<<<<<<<
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec = {"get_data_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint32_t __pyx_v_oid;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format;
  int __pyx_v_ignore_custom_codec;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_data_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(8, 91, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_data_codec", 0) < (0)) __PYX_ERR(8, 91, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_data_codec", 0, 1, 3, i); __PYX_ERR(8, 91, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(8, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(8, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(8, 91, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 91, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_format = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 92, __pyx_L3_error)
    } else {
      __pyx_v_format = __pyx_mstate_global->__pyx_k_;
    }
    if (values[2]) {
      __pyx_v_ignore_custom_codec = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ignore_custom_codec == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 93, __pyx_L3_error)
    } else {

      /* "asyncpg/protocol/settings.pyx":93
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):             # <<<<<<<<<<<<<<
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
 * 
*/
      __pyx_v_ignore_custom_codec = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_data_codec", 0, 1, 3, __pyx_nargs); __PYX_ERR(8, 91, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v_oid, __pyx_v_format, __pyx_v_ignore_custom_codec);

  /* "asyncpg/protocol/settings.pyx":91
 *                                                  typekind, alias_to, _format)
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,             # <<<<<<<<<<<<<<
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_14get_data_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, int __pyx_v_ignore_custom_codec) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_data_codec", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.format = __pyx_v_format;
  __pyx_t_2.ignore_custom_codec = __pyx_v_ignore_custom_codec;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings->get_data_codec(__pyx_v_self, __pyx_v_oid, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.get_data_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":96
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if not name.startswith('_'):
 *             try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_16__getattr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "asyncpg/protocol/settings.pyx":97
 * 
 *     def __getattr__(self, name):
 *         if not name.startswith('_'):             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._settings[name]
*/
  __pyx_t_2 = __pyx_v_name;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u__2};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "asyncpg/protocol/settings.pyx":98
 *     def __getattr__(self, name):
 *         if not name.startswith('_'):
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._settings[name]
 *             except KeyError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "asyncpg/protocol/settings.pyx":99
 *         if not name.startswith('_'):
 *             try:
 *                 return self._settings[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise AttributeError(name) from None
*/
        __Pyx_XDECREF(__pyx_r);
        if (unlikely(__pyx_v_self->_settings == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(8, 99, __pyx_L4_error)
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->_settings, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 99, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L8_try_return;

        /* "asyncpg/protocol/settings.pyx":98
 *     def __getattr__(self, name):
 *         if not name.startswith('_'):
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._settings[name]
 *             except KeyError:
*/
      }
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/settings.pyx":100
 *             try:
 *                 return self._settings[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise AttributeError(name) from None
 * 
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(8, 100, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "asyncpg/protocol/settings.pyx":101
 *                 return self._settings[name]
 *             except KeyError:
 *                 raise AttributeError(name) from None             # <<<<<<<<<<<<<<
 * 
 *         return object.__getattribute__(self, name)
*/
        __pyx_t_12 = NULL;
        __pyx_t_3 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_name};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_AttributeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 101, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_Raise(__pyx_t_11, 0, 0, Py_None);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(8, 101, __pyx_L6_except_error)
      }
      goto __pyx_L6_except_error;

      /* "asyncpg/protocol/settings.pyx":98
 *     def __getattr__(self, name):
 *         if not name.startswith('_'):
 *             try:             # <<<<<<<<<<<<<<
 *                 return self._settings[name]
 *             except KeyError:
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L0;
    }

    /* "asyncpg/protocol/settings.pyx":97
 * 
 *     def __getattr__(self, name):
 *         if not name.startswith('_'):             # <<<<<<<<<<<<<<
 *             try:
 *                 return self._settings[name]
*/
  }

  /* "asyncpg/protocol/settings.pyx":103
 *                 raise AttributeError(name) from None
 * 
 *         return object.__getattribute__(self, name)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_builtin_object;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_name};
    __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getattribute, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  __pyx_r = __pyx_t_10;
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/settings.pyx":96
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
 * 
 *     def __getattr__(self, name):             # <<<<<<<<<<<<<<
 *         if not name.startswith('_'):
 *             try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/settings.pyx":105
 *         return object.__getattribute__(self, name)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ConnectionSettings {!r}>'.format(self._settings)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_18__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asyncpg/protocol/settings.pyx":106
 * 
 *     def __repr__(self):
 *         return '<ConnectionSettings {!r}>'.format(self._settings)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u_ConnectionSettings_r;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->_settings};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/settings.pyx":105
 *         return object.__getattribute__(self, name)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<ConnectionSettings {!r}>'.format(self._settings)
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_20__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_18ConnectionSettings_22__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.ConnectionSettings.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":20
 * cdef class CodecMap:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.extra_codecs = {}
 *         self.binary_codec_map = <void **>cpython.PyMem_Calloc(
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/codecs/base.pyx":21
 * 
 *     def __cinit__(self):
 *         self.extra_codecs = {}             # <<<<<<<<<<<<<<
 *         self.binary_codec_map = <void **>cpython.PyMem_Calloc(
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->extra_codecs);
  __Pyx_DECREF(__pyx_v_self->extra_codecs);
  __pyx_v_self->extra_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":22
 *     def __cinit__(self):
 *         self.extra_codecs = {}
 *         self.binary_codec_map = <void **>cpython.PyMem_Calloc(             # <<<<<<<<<<<<<<
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
 *         self.text_codec_map = <void **>cpython.PyMem_Calloc(
*/
  __pyx_v_self->binary_codec_map = ((void **)PyMem_Calloc(0x27b2, (sizeof(void *))));

  /* "asyncpg/protocol/codecs/base.pyx":24
 *         self.binary_codec_map = <void **>cpython.PyMem_Calloc(
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
 *         self.text_codec_map = <void **>cpython.PyMem_Calloc(             # <<<<<<<<<<<<<<
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
 * 
*/
  __pyx_v_self->text_codec_map = ((void **)PyMem_Calloc(0x27b2, (sizeof(void *))));

  /* "asyncpg/protocol/codecs/base.pyx":20
 * cdef class CodecMap:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.extra_codecs = {}
 *         self.binary_codec_map = <void **>cpython.PyMem_Calloc(
*/

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

/* "asyncpg/protocol/codecs/base.pyx":27
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
 * 
 *     cdef inline void *get_binary_codec_ptr(self, uint32_t idx):             # <<<<<<<<<<<<<<
 *         return <void*>self.binary_codec_map[idx]
 * 
*/

static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx) {
  void *__pyx_r;

  /* "asyncpg/protocol/codecs/base.pyx":28
 * 
 *     cdef inline void *get_binary_codec_ptr(self, uint32_t idx):
 *         return <void*>self.binary_codec_map[idx]             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr):
*/
  __pyx_r = ((void *)(__pyx_v_self->binary_codec_map[__pyx_v_idx]));
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":27
 *             (MAXSUPPORTEDOID + 1) * 2, sizeof(void *))
 * 
 *     cdef inline void *get_binary_codec_ptr(self, uint32_t idx):             # <<<<<<<<<<<<<<
 *         return <void*>self.binary_codec_map[idx]
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":30
 *         return <void*>self.binary_codec_map[idx]
 * 
 *     cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr):             # <<<<<<<<<<<<<<
 *         self.binary_codec_map[idx] = ptr
 * 
*/

static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr) {

  /* "asyncpg/protocol/codecs/base.pyx":31
 * 
 *     cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr):
 *         self.binary_codec_map[idx] = ptr             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void *get_text_codec_ptr(self, uint32_t idx):
*/
  (__pyx_v_self->binary_codec_map[__pyx_v_idx]) = __pyx_v_ptr;

  /* "asyncpg/protocol/codecs/base.pyx":30
 *         return <void*>self.binary_codec_map[idx]
 * 
 *     cdef inline void set_binary_codec_ptr(self, uint32_t idx, void *ptr):             # <<<<<<<<<<<<<<
 *         self.binary_codec_map[idx] = ptr
 * 
*/

  /* function exit code */
}

/* "asyncpg/protocol/codecs/base.pyx":33
 *         self.binary_codec_map[idx] = ptr
 * 
 *     cdef inline void *get_text_codec_ptr(self, uint32_t idx):             # <<<<<<<<<<<<<<
 *         return <void*>self.text_codec_map[idx]
 * 
*/

static CYTHON_INLINE void *__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx) {
  void *__pyx_r;

  /* "asyncpg/protocol/codecs/base.pyx":34
 * 
 *     cdef inline void *get_text_codec_ptr(self, uint32_t idx):
 *         return <void*>self.text_codec_map[idx]             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr):
*/
  __pyx_r = ((void *)(__pyx_v_self->text_codec_map[__pyx_v_idx]));
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":33
 *         self.binary_codec_map[idx] = ptr
 * 
 *     cdef inline void *get_text_codec_ptr(self, uint32_t idx):             # <<<<<<<<<<<<<<
 *         return <void*>self.text_codec_map[idx]
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":36
 *         return <void*>self.text_codec_map[idx]
 * 
 *     cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr):             # <<<<<<<<<<<<<<
 *         self.text_codec_map[idx] = ptr
 * 
*/

static CYTHON_INLINE void __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *__pyx_v_self, uint32_t __pyx_v_idx, void *__pyx_v_ptr) {

  /* "asyncpg/protocol/codecs/base.pyx":37
 * 
 *     cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr):
 *         self.text_codec_map[idx] = ptr             # <<<<<<<<<<<<<<
 * 
 * 
*/
  (__pyx_v_self->text_codec_map[__pyx_v_idx]) = __pyx_v_ptr;

  /* "asyncpg/protocol/codecs/base.pyx":36
 *         return <void*>self.text_codec_map[idx]
 * 
 *     cdef inline void set_text_codec_ptr(self, uint32_t idx, void *ptr):             # <<<<<<<<<<<<<<
 *         self.text_codec_map[idx] = ptr
 * 
*/

  /* function exit code */
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_2__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CodecMap.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CodecMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_8CodecMap_4__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CodecMap.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":46
 * cdef class Codec:
 * 
 *     def __cinit__(self, uint32_t oid):             # <<<<<<<<<<<<<<
 *         self.oid = oid
 *         self.type = CODEC_UNDEFINED
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  uint32_t __pyx_v_oid;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 46, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 46, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 46, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(1, 46, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 46, __pyx_L3_error)
    }
    __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 46, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self), __pyx_v_oid);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7asyncpg_8protocol_8protocol_5Codec___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, uint32_t __pyx_v_oid) {
  int __pyx_r;

  /* "asyncpg/protocol/codecs/base.pyx":47
 * 
 *     def __cinit__(self, uint32_t oid):
 *         self.oid = oid             # <<<<<<<<<<<<<<
 *         self.type = CODEC_UNDEFINED
 * 
*/
  __pyx_v_self->oid = __pyx_v_oid;

  /* "asyncpg/protocol/codecs/base.pyx":48
 *     def __cinit__(self, uint32_t oid):
 *         self.oid = oid
 *         self.type = CODEC_UNDEFINED             # <<<<<<<<<<<<<<
 * 
 *     cdef init(
*/
  __pyx_v_self->type = __pyx_e_7asyncpg_8protocol_8protocol_CODEC_UNDEFINED;

  /* "asyncpg/protocol/codecs/base.pyx":46
 * cdef class Codec:
 * 
 *     def __cinit__(self, uint32_t oid):             # <<<<<<<<<<<<<<
 *         self.oid = oid
 *         self.type = CODEC_UNDEFINED
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":50
 *         self.type = CODEC_UNDEFINED
 * 
 *     cdef init(             # <<<<<<<<<<<<<<
 *         self,
 *         str name,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType __pyx_v_type, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, PyObject *__pyx_v_py_encoder, PyObject *__pyx_v_py_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names, PyObject *__pyx_v_element_codecs, Py_UCS4 __pyx_v_element_delimiter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "asyncpg/protocol/codecs/base.pyx":70
 *     ):
 * 
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.schema = schema
 *         self.kind = kind
*/
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "asyncpg/protocol/codecs/base.pyx":71
 * 
 *         self.name = name
 *         self.schema = schema             # <<<<<<<<<<<<<<
 *         self.kind = kind
 *         self.type = type
*/
  __Pyx_INCREF(__pyx_v_schema);
  __Pyx_GIVEREF(__pyx_v_schema);
  __Pyx_GOTREF(__pyx_v_self->schema);
  __Pyx_DECREF(__pyx_v_self->schema);
  __pyx_v_self->schema = __pyx_v_schema;

  /* "asyncpg/protocol/codecs/base.pyx":72
 *         self.name = name
 *         self.schema = schema
 *         self.kind = kind             # <<<<<<<<<<<<<<
 *         self.type = type
 *         self.format = format
*/
  __Pyx_INCREF(__pyx_v_kind);
  __Pyx_GIVEREF(__pyx_v_kind);
  __Pyx_GOTREF(__pyx_v_self->kind);
  __Pyx_DECREF(__pyx_v_self->kind);
  __pyx_v_self->kind = __pyx_v_kind;

  /* "asyncpg/protocol/codecs/base.pyx":73
 *         self.schema = schema
 *         self.kind = kind
 *         self.type = type             # <<<<<<<<<<<<<<
 *         self.format = format
 *         self.xformat = xformat
*/
  __pyx_v_self->type = __pyx_v_type;

  /* "asyncpg/protocol/codecs/base.pyx":74
 *         self.kind = kind
 *         self.type = type
 *         self.format = format             # <<<<<<<<<<<<<<
 *         self.xformat = xformat
 *         self.c_encoder = c_encoder
*/
  __pyx_v_self->format = __pyx_v_format;

  /* "asyncpg/protocol/codecs/base.pyx":75
 *         self.type = type
 *         self.format = format
 *         self.xformat = xformat             # <<<<<<<<<<<<<<
 *         self.c_encoder = c_encoder
 *         self.c_decoder = c_decoder
*/
  __pyx_v_self->xformat = __pyx_v_xformat;

  /* "asyncpg/protocol/codecs/base.pyx":76
 *         self.format = format
 *         self.xformat = xformat
 *         self.c_encoder = c_encoder             # <<<<<<<<<<<<<<
 *         self.c_decoder = c_decoder
 *         self.base_codec = base_codec
*/
  __pyx_v_self->c_encoder = __pyx_v_c_encoder;

  /* "asyncpg/protocol/codecs/base.pyx":77
 *         self.xformat = xformat
 *         self.c_encoder = c_encoder
 *         self.c_decoder = c_decoder             # <<<<<<<<<<<<<<
 *         self.base_codec = base_codec
 *         self.py_encoder = py_encoder
*/
  __pyx_v_self->c_decoder = __pyx_v_c_decoder;

  /* "asyncpg/protocol/codecs/base.pyx":78
 *         self.c_encoder = c_encoder
 *         self.c_decoder = c_decoder
 *         self.base_codec = base_codec             # <<<<<<<<<<<<<<
 *         self.py_encoder = py_encoder
 *         self.py_decoder = py_decoder
*/
  __Pyx_INCREF((PyObject *)__pyx_v_base_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_base_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->base_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->base_codec);
  __pyx_v_self->base_codec = __pyx_v_base_codec;

  /* "asyncpg/protocol/codecs/base.pyx":79
 *         self.c_decoder = c_decoder
 *         self.base_codec = base_codec
 *         self.py_encoder = py_encoder             # <<<<<<<<<<<<<<
 *         self.py_decoder = py_decoder
 *         self.element_codec = element_codec
*/
  __Pyx_INCREF(__pyx_v_py_encoder);
  __Pyx_GIVEREF(__pyx_v_py_encoder);
  __Pyx_GOTREF(__pyx_v_self->py_encoder);
  __Pyx_DECREF(__pyx_v_self->py_encoder);
  __pyx_v_self->py_encoder = __pyx_v_py_encoder;

  /* "asyncpg/protocol/codecs/base.pyx":80
 *         self.base_codec = base_codec
 *         self.py_encoder = py_encoder
 *         self.py_decoder = py_decoder             # <<<<<<<<<<<<<<
 *         self.element_codec = element_codec
 *         self.element_type_oids = element_type_oids
*/
  __Pyx_INCREF(__pyx_v_py_decoder);
  __Pyx_GIVEREF(__pyx_v_py_decoder);
  __Pyx_GOTREF(__pyx_v_self->py_decoder);
  __Pyx_DECREF(__pyx_v_self->py_decoder);
  __pyx_v_self->py_decoder = __pyx_v_py_decoder;

  /* "asyncpg/protocol/codecs/base.pyx":81
 *         self.py_encoder = py_encoder
 *         self.py_decoder = py_decoder
 *         self.element_codec = element_codec             # <<<<<<<<<<<<<<
 *         self.element_type_oids = element_type_oids
 *         self.element_codecs = element_codecs
*/
  __Pyx_INCREF((PyObject *)__pyx_v_element_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_element_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->element_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->element_codec);
  __pyx_v_self->element_codec = __pyx_v_element_codec;

  /* "asyncpg/protocol/codecs/base.pyx":82
 *         self.py_decoder = py_decoder
 *         self.element_codec = element_codec
 *         self.element_type_oids = element_type_oids             # <<<<<<<<<<<<<<
 *         self.element_codecs = element_codecs
 *         self.element_delimiter = element_delimiter
*/
  __Pyx_INCREF(__pyx_v_element_type_oids);
  __Pyx_GIVEREF(__pyx_v_element_type_oids);
  __Pyx_GOTREF(__pyx_v_self->element_type_oids);
  __Pyx_DECREF(__pyx_v_self->element_type_oids);
  __pyx_v_self->element_type_oids = __pyx_v_element_type_oids;

  /* "asyncpg/protocol/codecs/base.pyx":83
 *         self.element_codec = element_codec
 *         self.element_type_oids = element_type_oids
 *         self.element_codecs = element_codecs             # <<<<<<<<<<<<<<
 *         self.element_delimiter = element_delimiter
 *         self.element_names = element_names
*/
  __Pyx_INCREF(__pyx_v_element_codecs);
  __Pyx_GIVEREF(__pyx_v_element_codecs);
  __Pyx_GOTREF(__pyx_v_self->element_codecs);
  __Pyx_DECREF(__pyx_v_self->element_codecs);
  __pyx_v_self->element_codecs = __pyx_v_element_codecs;

  /* "asyncpg/protocol/codecs/base.pyx":84
 *         self.element_type_oids = element_type_oids
 *         self.element_codecs = element_codecs
 *         self.element_delimiter = element_delimiter             # <<<<<<<<<<<<<<
 *         self.element_names = element_names
 * 
*/
  __pyx_v_self->element_delimiter = __pyx_v_element_delimiter;

  /* "asyncpg/protocol/codecs/base.pyx":85
 *         self.element_codecs = element_codecs
 *         self.element_delimiter = element_delimiter
 *         self.element_names = element_names             # <<<<<<<<<<<<<<
 * 
 *         if base_codec is not None:
*/
  __Pyx_INCREF(__pyx_v_element_names);
  __Pyx_GIVEREF(__pyx_v_element_names);
  __Pyx_GOTREF(__pyx_v_self->element_names);
  __Pyx_DECREF(__pyx_v_self->element_names);
  __pyx_v_self->element_names = __pyx_v_element_names;

  /* "asyncpg/protocol/codecs/base.pyx":87
 *         self.element_names = element_names
 * 
 *         if base_codec is not None:             # <<<<<<<<<<<<<<
 *             if c_encoder != NULL or c_decoder != NULL:
 *                 raise exceptions.InternalClientError(
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_base_codec) != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":88
 * 
 *         if base_codec is not None:
 *             if c_encoder != NULL or c_decoder != NULL:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'base_codec is mutually exclusive with c_encoder/c_decoder'
*/
    __pyx_t_2 = (__pyx_v_c_encoder != NULL);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_c_decoder != NULL);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/base.pyx":89
 *         if base_codec is not None:
 *             if c_encoder != NULL or c_decoder != NULL:
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'base_codec is mutually exclusive with c_encoder/c_decoder'
 *                 )
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_base_codec_is_mutually_exclusive};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 89, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":88
 * 
 *         if base_codec is not None:
 *             if c_encoder != NULL or c_decoder != NULL:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'base_codec is mutually exclusive with c_encoder/c_decoder'
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":87
 *         self.element_names = element_names
 * 
 *         if base_codec is not None:             # <<<<<<<<<<<<<<
 *             if c_encoder != NULL or c_decoder != NULL:
 *                 raise exceptions.InternalClientError(
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":93
 *                 )
 * 
 *         if element_names is not None:             # <<<<<<<<<<<<<<
 *             self.record_desc = RecordDescriptor(
 *                 element_names, tuple(element_names))
*/
  __pyx_t_1 = (__pyx_v_element_names != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":94
 * 
 *         if element_names is not None:
 *             self.record_desc = RecordDescriptor(             # <<<<<<<<<<<<<<
 *                 element_names, tuple(element_names))
 *         else:
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "asyncpg/protocol/codecs/base.pyx":95
 *         if element_names is not None:
 *             self.record_desc = RecordDescriptor(
 *                 element_names, tuple(element_names))             # <<<<<<<<<<<<<<
 *         else:
 *             self.record_desc = None
*/
    __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_element_names); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_element_names, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }

    /* "asyncpg/protocol/codecs/base.pyx":94
 * 
 *         if element_names is not None:
 *             self.record_desc = RecordDescriptor(             # <<<<<<<<<<<<<<
 *                 element_names, tuple(element_names))
 *         else:
*/
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->record_desc);
    __Pyx_DECREF(__pyx_v_self->record_desc);
    __pyx_v_self->record_desc = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":93
 *                 )
 * 
 *         if element_names is not None:             # <<<<<<<<<<<<<<
 *             self.record_desc = RecordDescriptor(
 *                 element_names, tuple(element_names))
*/
    goto __pyx_L7;
  }

  /* "asyncpg/protocol/codecs/base.pyx":97
 *                 element_names, tuple(element_names))
 *         else:
 *             self.record_desc = None             # <<<<<<<<<<<<<<
 * 
 *         if type == CODEC_C:
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->record_desc);
    __Pyx_DECREF(__pyx_v_self->record_desc);
    __pyx_v_self->record_desc = Py_None;
  }
  __pyx_L7:;

  /* "asyncpg/protocol/codecs/base.pyx":99
 *             self.record_desc = None
 * 
 *         if type == CODEC_C:             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_scalar
 *             self.decoder = <codec_decode_func>&self.decode_scalar
*/
  switch (__pyx_v_type) {
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C:

    /* "asyncpg/protocol/codecs/base.pyx":100
 * 
 *         if type == CODEC_C:
 *             self.encoder = <codec_encode_func>&self.encode_scalar             # <<<<<<<<<<<<<<
 *             self.decoder = <codec_decode_func>&self.decode_scalar
 *         elif type == CODEC_ARRAY:
*/
    __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar));

    /* "asyncpg/protocol/codecs/base.pyx":101
 *         if type == CODEC_C:
 *             self.encoder = <codec_encode_func>&self.encode_scalar
 *             self.decoder = <codec_decode_func>&self.decode_scalar             # <<<<<<<<<<<<<<
 *         elif type == CODEC_ARRAY:
 *             if format == PG_FORMAT_BINARY:
*/
    __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar));

    /* "asyncpg/protocol/codecs/base.pyx":99
 *             self.record_desc = None
 * 
 *         if type == CODEC_C:             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_scalar
 *             self.decoder = <codec_decode_func>&self.decode_scalar
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY:

    /* "asyncpg/protocol/codecs/base.pyx":103
 *             self.decoder = <codec_decode_func>&self.decode_scalar
 *         elif type == CODEC_ARRAY:
 *             if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 self.encoder = <codec_encode_func>&self.encode_array
 *                 self.decoder = <codec_decode_func>&self.decode_array
*/
    __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":104
 *         elif type == CODEC_ARRAY:
 *             if format == PG_FORMAT_BINARY:
 *                 self.encoder = <codec_encode_func>&self.encode_array             # <<<<<<<<<<<<<<
 *                 self.decoder = <codec_decode_func>&self.decode_array
 *             else:
*/
      __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array));

      /* "asyncpg/protocol/codecs/base.pyx":105
 *             if format == PG_FORMAT_BINARY:
 *                 self.encoder = <codec_encode_func>&self.encode_array
 *                 self.decoder = <codec_decode_func>&self.decode_array             # <<<<<<<<<<<<<<
 *             else:
 *                 self.encoder = <codec_encode_func>&self.encode_array_text
*/
      __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array));

      /* "asyncpg/protocol/codecs/base.pyx":103
 *             self.decoder = <codec_decode_func>&self.decode_scalar
 *         elif type == CODEC_ARRAY:
 *             if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 self.encoder = <codec_encode_func>&self.encode_array
 *                 self.decoder = <codec_decode_func>&self.decode_array
*/
      goto __pyx_L8;
    }

    /* "asyncpg/protocol/codecs/base.pyx":107
 *                 self.decoder = <codec_decode_func>&self.decode_array
 *             else:
 *                 self.encoder = <codec_encode_func>&self.encode_array_text             # <<<<<<<<<<<<<<
 *                 self.decoder = <codec_decode_func>&self.decode_array_text
 *         elif type == CODEC_RANGE:
*/
    /*else*/ {
      __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text));

      /* "asyncpg/protocol/codecs/base.pyx":108
 *             else:
 *                 self.encoder = <codec_encode_func>&self.encode_array_text
 *                 self.decoder = <codec_decode_func>&self.decode_array_text             # <<<<<<<<<<<<<<
 *         elif type == CODEC_RANGE:
 *             if format != PG_FORMAT_BINARY:
*/
      __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text));
    }
    __pyx_L8:;

    /* "asyncpg/protocol/codecs/base.pyx":102
 *             self.encoder = <codec_encode_func>&self.encode_scalar
 *             self.decoder = <codec_decode_func>&self.decode_scalar
 *         elif type == CODEC_ARRAY:             # <<<<<<<<<<<<<<
 *             if format == PG_FORMAT_BINARY:
 *                 self.encoder = <codec_encode_func>&self.encode_array
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE:

    /* "asyncpg/protocol/codecs/base.pyx":110
 *                 self.decoder = <codec_decode_func>&self.decode_array_text
 *         elif type == CODEC_RANGE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/base.pyx":111
 *         elif type == CODEC_RANGE:
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(             # <<<<<<<<<<<<<<
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":113
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_range
 *             self.decoder = <codec_decode_func>&self.decode_range
*/
      __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 111, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":110
 *                 self.decoder = <codec_decode_func>&self.decode_array_text
 *         elif type == CODEC_RANGE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":114
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_range             # <<<<<<<<<<<<<<
 *             self.decoder = <codec_decode_func>&self.decode_range
 *         elif type == CODEC_MULTIRANGE:
*/
    __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range));

    /* "asyncpg/protocol/codecs/base.pyx":115
 *                     'range types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_range
 *             self.decoder = <codec_decode_func>&self.decode_range             # <<<<<<<<<<<<<<
 *         elif type == CODEC_MULTIRANGE:
 *             if format != PG_FORMAT_BINARY:
*/
    __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range));

    /* "asyncpg/protocol/codecs/base.pyx":109
 *                 self.encoder = <codec_encode_func>&self.encode_array_text
 *                 self.decoder = <codec_decode_func>&self.decode_array_text
 *         elif type == CODEC_RANGE:             # <<<<<<<<<<<<<<
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE:

    /* "asyncpg/protocol/codecs/base.pyx":117
 *             self.decoder = <codec_decode_func>&self.decode_range
 *         elif type == CODEC_MULTIRANGE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/base.pyx":118
 *         elif type == CODEC_MULTIRANGE:
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(             # <<<<<<<<<<<<<<
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":120
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_multirange
 *             self.decoder = <codec_decode_func>&self.decode_multirange
*/
      __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 118, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":117
 *             self.decoder = <codec_decode_func>&self.decode_range
 *         elif type == CODEC_MULTIRANGE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":121
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'range types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_multirange             # <<<<<<<<<<<<<<
 *             self.decoder = <codec_decode_func>&self.decode_multirange
 *         elif type == CODEC_COMPOSITE:
*/
    __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange));

    /* "asyncpg/protocol/codecs/base.pyx":122
 *                     'range types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_multirange
 *             self.decoder = <codec_decode_func>&self.decode_multirange             # <<<<<<<<<<<<<<
 *         elif type == CODEC_COMPOSITE:
 *             if format != PG_FORMAT_BINARY:
*/
    __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange));

    /* "asyncpg/protocol/codecs/base.pyx":116
 *             self.encoder = <codec_encode_func>&self.encode_range
 *             self.decoder = <codec_decode_func>&self.decode_range
 *         elif type == CODEC_MULTIRANGE:             # <<<<<<<<<<<<<<
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE:

    /* "asyncpg/protocol/codecs/base.pyx":124
 *             self.decoder = <codec_decode_func>&self.decode_multirange
 *         elif type == CODEC_COMPOSITE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    __pyx_t_1 = (__pyx_v_format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/base.pyx":125
 *         elif type == CODEC_COMPOSITE:
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(             # <<<<<<<<<<<<<<
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'composite types is not supported'.format(schema, name))
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":127
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'composite types is not supported'.format(schema, name))             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_composite
 *             self.decoder = <codec_decode_func>&self.decode_composite
*/
      __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_cannot_decode_type_text_encoding_2;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_schema, __pyx_v_name};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 125, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(1, 125, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":124
 *             self.decoder = <codec_decode_func>&self.decode_multirange
 *         elif type == CODEC_COMPOSITE:
 *             if format != PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 raise exceptions.UnsupportedClientFeatureError(
 *                     'cannot decode type "{}"."{}": text encoding of '
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":128
 *                     'cannot decode type "{}"."{}": text encoding of '
 *                     'composite types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_composite             # <<<<<<<<<<<<<<
 *             self.decoder = <codec_decode_func>&self.decode_composite
 *         elif type == CODEC_PY:
*/
    __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite));

    /* "asyncpg/protocol/codecs/base.pyx":129
 *                     'composite types is not supported'.format(schema, name))
 *             self.encoder = <codec_encode_func>&self.encode_composite
 *             self.decoder = <codec_decode_func>&self.decode_composite             # <<<<<<<<<<<<<<
 *         elif type == CODEC_PY:
 *             self.encoder = <codec_encode_func>&self.encode_in_python
*/
    __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite));

    /* "asyncpg/protocol/codecs/base.pyx":123
 *             self.encoder = <codec_encode_func>&self.encode_multirange
 *             self.decoder = <codec_decode_func>&self.decode_multirange
 *         elif type == CODEC_COMPOSITE:             # <<<<<<<<<<<<<<
 *             if format != PG_FORMAT_BINARY:
 *                 raise exceptions.UnsupportedClientFeatureError(
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY:

    /* "asyncpg/protocol/codecs/base.pyx":131
 *             self.decoder = <codec_decode_func>&self.decode_composite
 *         elif type == CODEC_PY:
 *             self.encoder = <codec_encode_func>&self.encode_in_python             # <<<<<<<<<<<<<<
 *             self.decoder = <codec_decode_func>&self.decode_in_python
 *         else:
*/
    __pyx_v_self->encoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python));

    /* "asyncpg/protocol/codecs/base.pyx":132
 *         elif type == CODEC_PY:
 *             self.encoder = <codec_encode_func>&self.encode_in_python
 *             self.decoder = <codec_decode_func>&self.decode_in_python             # <<<<<<<<<<<<<<
 *         else:
 *             raise exceptions.InternalClientError(
*/
    __pyx_v_self->decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_codec_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python));

    /* "asyncpg/protocol/codecs/base.pyx":130
 *             self.encoder = <codec_encode_func>&self.encode_composite
 *             self.decoder = <codec_decode_func>&self.decode_composite
 *         elif type == CODEC_PY:             # <<<<<<<<<<<<<<
 *             self.encoder = <codec_encode_func>&self.encode_in_python
 *             self.decoder = <codec_decode_func>&self.decode_in_python
*/
    break;
    default:

    /* "asyncpg/protocol/codecs/base.pyx":134
 *             self.decoder = <codec_decode_func>&self.decode_in_python
 *         else:
 *             raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                 'unexpected codec type: {}'.format(type))
 * 
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":135
 *         else:
 *             raise exceptions.InternalClientError(
 *                 'unexpected codec type: {}'.format(type))             # <<<<<<<<<<<<<<
 * 
 *     cdef Codec copy(self):
*/
    __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_codec_type;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 134, __pyx_L1_error)
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":50
 *         self.type = CODEC_UNDEFINED
 * 
 *     cdef init(             # <<<<<<<<<<<<<<
 *         self,
 *         str name,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":137
 *                 'unexpected codec type: {}'.format(type))
 * 
 *     cdef Codec copy(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "asyncpg/protocol/codecs/base.pyx":140
 *         cdef Codec codec
 * 
 *         codec = Codec(self.oid)             # <<<<<<<<<<<<<<
 *         codec.init(self.name, self.schema, self.kind,
 *                    self.type, self.format, self.xformat,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":141
 * 
 *         codec = Codec(self.oid)
 *         codec.init(self.name, self.schema, self.kind,             # <<<<<<<<<<<<<<
 *                    self.type, self.format, self.xformat,
 *                    self.c_encoder, self.c_decoder, self.base_codec,
*/
  __pyx_t_1 = __pyx_v_self->name;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __pyx_v_self->schema;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __pyx_v_self->kind;
  __Pyx_INCREF(__pyx_t_2);

  /* "asyncpg/protocol/codecs/base.pyx":143
 *         codec.init(self.name, self.schema, self.kind,
 *                    self.type, self.format, self.xformat,
 *                    self.c_encoder, self.c_decoder, self.base_codec,             # <<<<<<<<<<<<<<
 *                    self.py_encoder, self.py_decoder,
 *                    self.element_codec,
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self->base_codec);
  __Pyx_INCREF(__pyx_t_5);

  /* "asyncpg/protocol/codecs/base.pyx":144
 *                    self.type, self.format, self.xformat,
 *                    self.c_encoder, self.c_decoder, self.base_codec,
 *                    self.py_encoder, self.py_decoder,             # <<<<<<<<<<<<<<
 *                    self.element_codec,
 *                    self.element_type_oids, self.element_names,
*/
  __pyx_t_6 = __pyx_v_self->py_encoder;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_7 = __pyx_v_self->py_decoder;
  __Pyx_INCREF(__pyx_t_7);

  /* "asyncpg/protocol/codecs/base.pyx":145
 *                    self.c_encoder, self.c_decoder, self.base_codec,
 *                    self.py_encoder, self.py_decoder,
 *                    self.element_codec,             # <<<<<<<<<<<<<<
 *                    self.element_type_oids, self.element_names,
 *                    self.element_codecs, self.element_delimiter)
*/
  __pyx_t_8 = ((PyObject *)__pyx_v_self->element_codec);
  __Pyx_INCREF(__pyx_t_8);

  /* "asyncpg/protocol/codecs/base.pyx":146
 *                    self.py_encoder, self.py_decoder,
 *                    self.element_codec,
 *                    self.element_type_oids, self.element_names,             # <<<<<<<<<<<<<<
 *                    self.element_codecs, self.element_delimiter)
 * 
*/
  __pyx_t_9 = __pyx_v_self->element_type_oids;
  __Pyx_INCREF(__pyx_t_9);
  __pyx_t_10 = __pyx_v_self->element_names;
  __Pyx_INCREF(__pyx_t_10);

  /* "asyncpg/protocol/codecs/base.pyx":147
 *                    self.element_codec,
 *                    self.element_type_oids, self.element_names,
 *                    self.element_codecs, self.element_delimiter)             # <<<<<<<<<<<<<<
 * 
 *         return codec
*/
  __pyx_t_11 = __pyx_v_self->element_codecs;
  __Pyx_INCREF(__pyx_t_11);

  /* "asyncpg/protocol/codecs/base.pyx":141
 * 
 *         codec = Codec(self.oid)
 *         codec.init(self.name, self.schema, self.kind,             # <<<<<<<<<<<<<<
 *                    self.type, self.format, self.xformat,
 *                    self.c_encoder, self.c_decoder, self.base_codec,
*/
  __pyx_t_12 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2), __pyx_v_self->type, __pyx_v_self->format, __pyx_v_self->xformat, __pyx_v_self->c_encoder, __pyx_v_self->c_decoder, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5), __pyx_t_6, __pyx_t_7, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_8), ((PyObject*)__pyx_t_9), __pyx_t_10, ((PyObject*)__pyx_t_11), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":149
 *                    self.element_codecs, self.element_delimiter)
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":137
 *                 'unexpected codec type: {}'.format(type))
 * 
 *     cdef Codec copy(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":151
 *         return codec
 * 
 *     cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                        object obj):
 *         self.c_encoder(settings, buf, obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_scalar", 0);

  /* "asyncpg/protocol/codecs/base.pyx":153
 *     cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf,
 *                        object obj):
 *         self.c_encoder(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf,
*/
  __pyx_t_1 = __pyx_v_self->c_encoder(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":151
 *         return codec
 * 
 *     cdef encode_scalar(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                        object obj):
 *         self.c_encoder(settings, buf, obj)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":155
 *         self.c_encoder(settings, buf, obj)
 * 
 *     cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                       object obj):
 *         array_encode(settings, buf, obj, self.element_codec.oid,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_array", 0);

  /* "asyncpg/protocol/codecs/base.pyx":157
 *     cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf,
 *                       object obj):
 *         array_encode(settings, buf, obj, self.element_codec.oid,             # <<<<<<<<<<<<<<
 *                      codec_encode_func_ex,
 *                      <void*>(<cpython.PyObject>self.element_codec))
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":155
 *         self.c_encoder(settings, buf, obj)
 * 
 *     cdef encode_array(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                       object obj):
 *         array_encode(settings, buf, obj, self.element_codec.oid,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":161
 *                      <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                            object obj):
 *         return textarray_encode(settings, buf, obj,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_array_text", 0);

  /* "asyncpg/protocol/codecs/base.pyx":163
 *     cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf,
 *                            object obj):
 *         return textarray_encode(settings, buf, obj,             # <<<<<<<<<<<<<<
 *                                 codec_encode_func_ex,
 *                                 <void*>(<cpython.PyObject>self.element_codec),
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/base.pyx":166
 *                                 codec_encode_func_ex,
 *                                 <void*>(<cpython.PyObject>self.element_codec),
 *                                 self.element_delimiter)             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":161
 *                      <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_array_text(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                            object obj):
 *         return textarray_encode(settings, buf, obj,
*/

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

/* "asyncpg/protocol/codecs/base.pyx":168
 *                                 self.element_delimiter)
 * 
 *     cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                       object obj):
 *         range_encode(settings, buf, obj, self.element_codec.oid,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_range", 0);

  /* "asyncpg/protocol/codecs/base.pyx":170
 *     cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf,
 *                       object obj):
 *         range_encode(settings, buf, obj, self.element_codec.oid,             # <<<<<<<<<<<<<<
 *                      codec_encode_func_ex,
 *                      <void*>(<cpython.PyObject>self.element_codec))
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_range_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":168
 *                                 self.element_delimiter)
 * 
 *     cdef encode_range(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                       object obj):
 *         range_encode(settings, buf, obj, self.element_codec.oid,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":174
 *                      <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                            object obj):
 *         multirange_encode(settings, buf, obj, self.element_codec.oid,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_multirange", 0);

  /* "asyncpg/protocol/codecs/base.pyx":176
 *     cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf,
 *                            object obj):
 *         multirange_encode(settings, buf, obj, self.element_codec.oid,             # <<<<<<<<<<<<<<
 *                           codec_encode_func_ex,
 *                           <void*>(<cpython.PyObject>self.element_codec))
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj, __pyx_v_self->element_codec->oid, __pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":174
 *                      <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_multirange(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                            object obj):
 *         multirange_encode(settings, buf, obj, self.element_codec.oid,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_multirange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":180
 *                           <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  int __pyx_v_i;
  PyObject *__pyx_v_elem_codecs = 0;
  Py_ssize_t __pyx_v_count;
  Py_ssize_t __pyx_v_composite_size;
  PyObject *__pyx_v_rec = 0;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  size_t __pyx_t_18;
  int32_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_composite", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "asyncpg/protocol/codecs/base.pyx":185
 *             WriteBuffer elem_data
 *             int i
 *             list elem_codecs = self.element_codecs             # <<<<<<<<<<<<<<
 *             ssize_t count
 *             ssize_t composite_size
*/
  __pyx_t_1 = __pyx_v_self->element_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_elem_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":190
 *             tuple rec
 * 
 *         if isinstance(obj, MappingABC):             # <<<<<<<<<<<<<<
 *             # Input is dict-like, form a tuple
 *             composite_size = len(self.element_type_oids)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MappingABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/base.pyx":192
 *         if isinstance(obj, MappingABC):
 *             # Input is dict-like, form a tuple
 *             composite_size = len(self.element_type_oids)             # <<<<<<<<<<<<<<
 *             rec = cpython.PyTuple_New(composite_size)
 * 
*/
    __pyx_t_1 = __pyx_v_self->element_type_oids;
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_t_1 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(1, 192, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_composite_size = __pyx_t_3;

    /* "asyncpg/protocol/codecs/base.pyx":193
 *             # Input is dict-like, form a tuple
 *             composite_size = len(self.element_type_oids)
 *             rec = cpython.PyTuple_New(composite_size)             # <<<<<<<<<<<<<<
 * 
 *             for i in range(composite_size):
*/
    __pyx_t_1 = PyTuple_New(__pyx_v_composite_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_rec = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":195
 *             rec = cpython.PyTuple_New(composite_size)
 * 
 *             for i in range(composite_size):             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(None)
 *                 cpython.PyTuple_SET_ITEM(rec, i, None)
*/
    __pyx_t_4 = __pyx_v_composite_size;
    __pyx_t_5 = __pyx_t_4;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "asyncpg/protocol/codecs/base.pyx":196
 * 
 *             for i in range(composite_size):
 *                 cpython.Py_INCREF(None)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SET_ITEM(rec, i, None)
 * 
*/
      Py_INCREF(Py_None);

      /* "asyncpg/protocol/codecs/base.pyx":197
 *             for i in range(composite_size):
 *                 cpython.Py_INCREF(None)
 *                 cpython.PyTuple_SET_ITEM(rec, i, None)             # <<<<<<<<<<<<<<
 * 
 *             for field in obj:
*/
      PyTuple_SET_ITEM(__pyx_v_rec, __pyx_v_i, Py_None);
    }

    /* "asyncpg/protocol/codecs/base.pyx":199
 *                 cpython.PyTuple_SET_ITEM(rec, i, None)
 * 
 *             for field in obj:             # <<<<<<<<<<<<<<
 *                 try:
 *                     i = self.element_names[field]
*/
    if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
      __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 199, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 199, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 199, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
          #else
          __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 199, __pyx_L1_error)
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 199, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":200
 * 
 *             for field in obj:
 *                 try:             # <<<<<<<<<<<<<<
 *                     i = self.element_names[field]
 *                 except KeyError:
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "asyncpg/protocol/codecs/base.pyx":201
 *             for field in obj:
 *                 try:
 *                     i = self.element_names[field]             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     raise ValueError(
*/
          __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_self->element_names, __pyx_v_field); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 201, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 201, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_i = __pyx_t_6;

          /* "asyncpg/protocol/codecs/base.pyx":200
 * 
 *             for field in obj:
 *                 try:             # <<<<<<<<<<<<<<
 *                     i = self.element_names[field]
 *                 except KeyError:
*/
        }
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":202
 *                 try:
 *                     i = self.element_names[field]
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         '{!r} is not a valid element of composite '
*/
        __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
        if (__pyx_t_6) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_13) < 0) __PYX_ERR(1, 202, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);

          /* "asyncpg/protocol/codecs/base.pyx":203
 *                     i = self.element_names[field]
 *                 except KeyError:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         '{!r} is not a valid element of composite '
 *                         'type {}'.format(field, self.name)) from None
*/
          __pyx_t_15 = NULL;

          /* "asyncpg/protocol/codecs/base.pyx":205
 *                     raise ValueError(
 *                         '{!r} is not a valid element of composite '
 *                         'type {}'.format(field, self.name)) from None             # <<<<<<<<<<<<<<
 * 
 *                 item = obj[field]
*/
          __pyx_t_17 = __pyx_mstate_global->__pyx_kp_u_r_is_not_a_valid_element_of_com;
          __Pyx_INCREF(__pyx_t_17);
          __pyx_t_18 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_17, __pyx_v_field, __pyx_v_self->name};
            __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (3-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 205, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_16);
          }
          __pyx_t_18 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_16};
            __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 203, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_14);
          }
          __Pyx_Raise(__pyx_t_14, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __PYX_ERR(1, 203, __pyx_L10_except_error)
        }
        goto __pyx_L10_except_error;

        /* "asyncpg/protocol/codecs/base.pyx":200
 * 
 *             for field in obj:
 *                 try:             # <<<<<<<<<<<<<<
 *                     i = self.element_names[field]
 *                 except KeyError:
*/
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L15_try_end:;
      }

      /* "asyncpg/protocol/codecs/base.pyx":207
 *                         'type {}'.format(field, self.name)) from None
 * 
 *                 item = obj[field]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(item)
 *                 cpython.PyTuple_SET_ITEM(rec, i, item)
*/
      __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_obj, __pyx_v_field); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":208
 * 
 *                 item = obj[field]
 *                 cpython.Py_INCREF(item)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SET_ITEM(rec, i, item)
 * 
*/
      Py_INCREF(__pyx_v_item);

      /* "asyncpg/protocol/codecs/base.pyx":209
 *                 item = obj[field]
 *                 cpython.Py_INCREF(item)
 *                 cpython.PyTuple_SET_ITEM(rec, i, item)             # <<<<<<<<<<<<<<
 * 
 *             obj = rec
*/
      PyTuple_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_item);

      /* "asyncpg/protocol/codecs/base.pyx":199
 *                 cpython.PyTuple_SET_ITEM(rec, i, None)
 * 
 *             for field in obj:             # <<<<<<<<<<<<<<
 *                 try:
 *                     i = self.element_names[field]
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":211
 *                 cpython.PyTuple_SET_ITEM(rec, i, item)
 * 
 *             obj = rec             # <<<<<<<<<<<<<<
 * 
 *         count = len(obj)
*/
    __Pyx_INCREF(__pyx_v_rec);
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_v_rec);

    /* "asyncpg/protocol/codecs/base.pyx":190
 *             tuple rec
 * 
 *         if isinstance(obj, MappingABC):             # <<<<<<<<<<<<<<
 *             # Input is dict-like, form a tuple
 *             composite_size = len(self.element_type_oids)
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":213
 *             obj = rec
 * 
 *         count = len(obj)             # <<<<<<<<<<<<<<
 *         if count > _MAXINT32:
 *             raise ValueError('too many elements in composite type record')
*/
  __pyx_t_3 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 213, __pyx_L1_error)
  __pyx_v_count = __pyx_t_3;

  /* "asyncpg/protocol/codecs/base.pyx":214
 * 
 *         count = len(obj)
 *         if count > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in composite type record')
 * 
*/
  __pyx_t_2 = (__pyx_v_count > 0x7FFFFFFF);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/base.pyx":215
 *         count = len(obj)
 *         if count > _MAXINT32:
 *             raise ValueError('too many elements in composite type record')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
*/
    __pyx_t_13 = NULL;
    __pyx_t_18 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_composite_t};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 215, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":214
 * 
 *         count = len(obj)
 *         if count > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in composite type record')
 * 
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":217
 *             raise ValueError('too many elements in composite type record')
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         i = 0
 *         for item in obj:
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":218
 * 
 *         elem_data = WriteBuffer.new()
 *         i = 0             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
*/
  __pyx_v_i = 0;

  /* "asyncpg/protocol/codecs/base.pyx":219
 *         elem_data = WriteBuffer.new()
 *         i = 0
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
 *             if item is None:
*/
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 219, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 219, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 219, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 219, __pyx_L1_error)
    } else {
      __pyx_t_13 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_13)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 219, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_13);
    __pyx_t_13 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":220
 *         i = 0
 *         for item in obj:
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
*/
    if (unlikely(__pyx_v_self->element_type_oids == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 220, __pyx_L1_error)
    }
    __pyx_t_13 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_19 = __Pyx_PyLong_As_int32_t(__pyx_t_13); if (unlikely((__pyx_t_19 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 220, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, ((int32_t)__pyx_t_19)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":221
 *         for item in obj:
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
    __pyx_t_2 = (__pyx_v_item == Py_None);
    if (__pyx_t_2) {

      /* "asyncpg/protocol/codecs/base.pyx":222
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
 *             if item is None:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 (<Codec>elem_codecs[i]).encode(settings, elem_data, item)
*/
      __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":221
 *         for item in obj:
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
      goto __pyx_L22;
    }

    /* "asyncpg/protocol/codecs/base.pyx":224
 *                 elem_data.write_int32(-1)
 *             else:
 *                 (<Codec>elem_codecs[i]).encode(settings, elem_data, item)             # <<<<<<<<<<<<<<
 *             i += 1
 * 
*/
    /*else*/ {
      if (unlikely(__pyx_v_elem_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 224, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_elem_codecs, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13), __pyx_v_settings, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __pyx_L22:;

    /* "asyncpg/protocol/codecs/base.pyx":225
 *             else:
 *                 (<Codec>elem_codecs[i]).encode(settings, elem_data, item)
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *         record_encode_frame(settings, buf, elem_data, <int32_t>count)
*/
    __pyx_v_i = (__pyx_v_i + 1);

    /* "asyncpg/protocol/codecs/base.pyx":219
 *         elem_data = WriteBuffer.new()
 *         i = 0
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             elem_data.write_int32(<int32_t>self.element_type_oids[i])
 *             if item is None:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":227
 *             i += 1
 * 
 *         record_encode_frame(settings, buf, elem_data, <int32_t>count)             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(__pyx_v_settings, __pyx_v_buf, __pyx_v_elem_data, ((int32_t)__pyx_v_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":180
 *                           <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef encode_composite(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_elem_codecs);
  __Pyx_XDECREF(__pyx_v_rec);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":229
 *         record_encode_frame(settings, buf, elem_data, <int32_t>count)
 * 
 *     cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 *         data = self.py_encoder(obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_in_python", 0);

  /* "asyncpg/protocol/codecs/base.pyx":231
 *     cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf,
 *                           object obj):
 *         data = self.py_encoder(obj)             # <<<<<<<<<<<<<<
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_v_self->py_encoder);
  __pyx_t_3 = __pyx_v_self->py_encoder; 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_obj};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":232
 *                           object obj):
 *         data = self.py_encoder(obj)
 *         if self.xformat == PG_XFORMAT_OBJECT:             # <<<<<<<<<<<<<<
 *             if self.format == PG_FORMAT_BINARY:
 *                 pgproto.bytea_encode(settings, buf, data)
*/
  switch (__pyx_v_self->xformat) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT:

    /* "asyncpg/protocol/codecs/base.pyx":233
 *         data = self.py_encoder(obj)
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 pgproto.bytea_encode(settings, buf, data)
 *             elif self.format == PG_FORMAT_TEXT:
*/
    switch (__pyx_v_self->format) {
      case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY:

      /* "asyncpg/protocol/codecs/base.pyx":234
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:
 *                 pgproto.bytea_encode(settings, buf, data)             # <<<<<<<<<<<<<<
 *             elif self.format == PG_FORMAT_TEXT:
 *                 pgproto.text_encode(settings, buf, data)
*/
      __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":233
 *         data = self.py_encoder(obj)
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 pgproto.bytea_encode(settings, buf, data)
 *             elif self.format == PG_FORMAT_TEXT:
*/
      break;
      case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT:

      /* "asyncpg/protocol/codecs/base.pyx":236
 *                 pgproto.bytea_encode(settings, buf, data)
 *             elif self.format == PG_FORMAT_TEXT:
 *                 pgproto.text_encode(settings, buf, data)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise exceptions.InternalClientError(
*/
      __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":235
 *             if self.format == PG_FORMAT_BINARY:
 *                 pgproto.bytea_encode(settings, buf, data)
 *             elif self.format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                 pgproto.text_encode(settings, buf, data)
 *             else:
*/
      break;
      default:

      /* "asyncpg/protocol/codecs/base.pyx":238
 *                 pgproto.text_encode(settings, buf, data)
 *             else:
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":239
 *             else:
 *                 raise exceptions.InternalClientError(
 *                     'unexpected data format: {}'.format(self.format))             # <<<<<<<<<<<<<<
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:
*/
      __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_data_format;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 239, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 238, __pyx_L1_error)
      break;
    }

    /* "asyncpg/protocol/codecs/base.pyx":232
 *                           object obj):
 *         data = self.py_encoder(obj)
 *         if self.xformat == PG_XFORMAT_OBJECT:             # <<<<<<<<<<<<<<
 *             if self.format == PG_FORMAT_BINARY:
 *                 pgproto.bytea_encode(settings, buf, data)
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE:

    /* "asyncpg/protocol/codecs/base.pyx":241
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:             # <<<<<<<<<<<<<<
 *                 self.base_codec.encode(settings, buf, data)
 *             else:
*/
    __pyx_t_8 = (((PyObject *)__pyx_v_self->base_codec) != Py_None);
    if (__pyx_t_8) {

      /* "asyncpg/protocol/codecs/base.pyx":242
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:
 *                 self.base_codec.encode(settings, buf, data)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.c_encoder(settings, buf, data)
*/
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_v_self->base_codec, __pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":241
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:             # <<<<<<<<<<<<<<
 *                 self.base_codec.encode(settings, buf, data)
 *             else:
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/codecs/base.pyx":244
 *                 self.base_codec.encode(settings, buf, data)
 *             else:
 *                 self.c_encoder(settings, buf, data)             # <<<<<<<<<<<<<<
 *         else:
 *             raise exceptions.InternalClientError(
*/
    /*else*/ {
      __pyx_t_1 = __pyx_v_self->c_encoder(__pyx_v_settings, __pyx_v_buf, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L3:;

    /* "asyncpg/protocol/codecs/base.pyx":240
 *                 raise exceptions.InternalClientError(
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:             # <<<<<<<<<<<<<<
 *             if self.base_codec is not None:
 *                 self.base_codec.encode(settings, buf, data)
*/
    break;
    default:

    /* "asyncpg/protocol/codecs/base.pyx":246
 *                 self.c_encoder(settings, buf, data)
 *         else:
 *             raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                 'unexpected exchange format: {}'.format(self.xformat))
 * 
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":247
 *         else:
 *             raise exceptions.InternalClientError(
 *                 'unexpected exchange format: {}'.format(self.xformat))             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, ConnectionSettings settings, WriteBuffer buf,
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_exchange_format;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 246, __pyx_L1_error)
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":229
 *         record_encode_frame(settings, buf, elem_data, <int32_t>count)
 * 
 *     cdef encode_in_python(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 *         data = self.py_encoder(obj)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.encode_in_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":249
 *                 'unexpected exchange format: {}'.format(self.xformat))
 * 
 *     cdef encode(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                 object obj):
 *         return self.encoder(self, settings, buf, obj)
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 0);

  /* "asyncpg/protocol/codecs/base.pyx":251
 *     cdef encode(self, ConnectionSettings settings, WriteBuffer buf,
 *                 object obj):
 *         return self.encoder(self, settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->encoder(__pyx_v_self, __pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":249
 *                 'unexpected exchange format: {}'.format(self.xformat))
 * 
 *     cdef encode(self, ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                 object obj):
 *         return self.encoder(self, settings, buf, obj)
*/

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

/* "asyncpg/protocol/codecs/base.pyx":253
 *         return self.encoder(self, settings, buf, obj)
 * 
 *     cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.c_decoder(settings, buf)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_scalar", 0);

  /* "asyncpg/protocol/codecs/base.pyx":254
 * 
 *     cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf):
 *         return self.c_decoder(settings, buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->c_decoder(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":253
 *         return self.encoder(self, settings, buf, obj)
 * 
 *     cdef decode_scalar(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.c_decoder(settings, buf)
 * 
*/

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

/* "asyncpg/protocol/codecs/base.pyx":256
 *         return self.c_decoder(settings, buf)
 * 
 *     cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return array_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_array", 0);

  /* "asyncpg/protocol/codecs/base.pyx":257
 * 
 *     cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf):
 *         return array_decode(settings, buf, codec_decode_func_ex,             # <<<<<<<<<<<<<<
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/base.pyx":258
 *     cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf):
 *         return array_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_array_text(self, ConnectionSettings settings,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":256
 *         return self.c_decoder(settings, buf)
 * 
 *     cdef decode_array(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return array_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))
*/

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

/* "asyncpg/protocol/codecs/base.pyx":260
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_array_text(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                            FRBuffer *buf):
 *         return textarray_decode(settings, buf, codec_decode_func_ex,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_array_text", 0);

  /* "asyncpg/protocol/codecs/base.pyx":262
 *     cdef decode_array_text(self, ConnectionSettings settings,
 *                            FRBuffer *buf):
 *         return textarray_decode(settings, buf, codec_decode_func_ex,             # <<<<<<<<<<<<<<
 *                                 <void*>(<cpython.PyObject>self.element_codec),
 *                                 self.element_delimiter)
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/base.pyx":264
 *         return textarray_decode(settings, buf, codec_decode_func_ex,
 *                                 <void*>(<cpython.PyObject>self.element_codec),
 *                                 self.element_delimiter)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf):
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec), __pyx_v_self->element_delimiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":260
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_array_text(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                            FRBuffer *buf):
 *         return textarray_decode(settings, buf, codec_decode_func_ex,
*/

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

/* "asyncpg/protocol/codecs/base.pyx":266
 *                                 self.element_delimiter)
 * 
 *     cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return range_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_range", 0);

  /* "asyncpg/protocol/codecs/base.pyx":267
 * 
 *     cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf):
 *         return range_decode(settings, buf, codec_decode_func_ex,             # <<<<<<<<<<<<<<
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/base.pyx":268
 *     cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf):
 *         return range_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf):
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_range_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":266
 *                                 self.element_delimiter)
 * 
 *     cdef decode_range(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return range_decode(settings, buf, codec_decode_func_ex,
 *                             <void*>(<cpython.PyObject>self.element_codec))
*/

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

/* "asyncpg/protocol/codecs/base.pyx":270
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return multirange_decode(settings, buf, codec_decode_func_ex,
 *                                  <void*>(<cpython.PyObject>self.element_codec))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_multirange", 0);

  /* "asyncpg/protocol/codecs/base.pyx":271
 * 
 *     cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf):
 *         return multirange_decode(settings, buf, codec_decode_func_ex,             # <<<<<<<<<<<<<<
 *                                  <void*>(<cpython.PyObject>self.element_codec))
 * 
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/base.pyx":272
 *     cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf):
 *         return multirange_decode(settings, buf, codec_decode_func_ex,
 *                                  <void*>(<cpython.PyObject>self.element_codec))             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_composite(self, ConnectionSettings settings,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(__pyx_v_settings, __pyx_v_buf, __pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex, ((void *)__pyx_v_self->element_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":270
 *                             <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_multirange(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return multirange_decode(settings, buf, codec_decode_func_ex,
 *                                  <void*>(<cpython.PyObject>self.element_codec))
*/

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

/* "asyncpg/protocol/codecs/base.pyx":274
 *                                  <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_composite(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf):
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  uint32_t __pyx_v_elem_typ;
  uint32_t __pyx_v_received_elem_typ;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  uint32_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_composite", 0);

  /* "asyncpg/protocol/codecs/base.pyx":286
 *             FRBuffer elem_buf
 * 
 *         elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if elem_count != len(self.element_type_oids):
 *             raise exceptions.OutdatedSchemaCacheError(
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 286, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "asyncpg/protocol/codecs/base.pyx":287
 * 
 *         elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != len(self.element_type_oids):             # <<<<<<<<<<<<<<
 *             raise exceptions.OutdatedSchemaCacheError(
 *                 'unexpected number of attributes of composite type: '
*/
  __pyx_t_2 = __pyx_v_self->element_type_oids;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 287, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "asyncpg/protocol/codecs/base.pyx":288
 *         elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != len(self.element_type_oids):
 *             raise exceptions.OutdatedSchemaCacheError(             # <<<<<<<<<<<<<<
 *                 'unexpected number of attributes of composite type: '
 *                 '{}, expected {}'
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":291
 *                 'unexpected number of attributes of composite type: '
 *                 '{}, expected {}'
 *                     .format(             # <<<<<<<<<<<<<<
 *                         elem_count,
 *                         len(self.element_type_oids),
*/
    __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_number_of_attributes;
    __Pyx_INCREF(__pyx_t_8);

    /* "asyncpg/protocol/codecs/base.pyx":292
 *                 '{}, expected {}'
 *                     .format(
 *                         elem_count,             # <<<<<<<<<<<<<<
 *                         len(self.element_type_oids),
 *                     ),
*/
    __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_elem_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "asyncpg/protocol/codecs/base.pyx":293
 *                     .format(
 *                         elem_count,
 *                         len(self.element_type_oids),             # <<<<<<<<<<<<<<
 *                     ),
 *                 schema=self.schema,
*/
    __pyx_t_10 = __pyx_v_self->element_type_oids;
    __Pyx_INCREF(__pyx_t_10);
    if (unlikely(__pyx_t_10 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(1, 293, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_9, __pyx_t_10};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }

    /* "asyncpg/protocol/codecs/base.pyx":296
 *                     ),
 *                 schema=self.schema,
 *                 data_type=self.name,             # <<<<<<<<<<<<<<
 *             )
 *         result = self.record_desc.make_record(asyncpg.Record, elem_count)
*/
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_self->schema, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(1, 288, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_type, __pyx_v_self->name, __pyx_t_10, __pyx_callargs+2, 1) < (0)) __PYX_ERR(1, 288, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 288, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":287
 * 
 *         elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != len(self.element_type_oids):             # <<<<<<<<<<<<<<
 *             raise exceptions.OutdatedSchemaCacheError(
 *                 'unexpected number of attributes of composite type: '
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":298
 *                 data_type=self.name,
 *             )
 *         result = self.record_desc.make_record(asyncpg.Record, elem_count)             # <<<<<<<<<<<<<<
 *         for i in range(elem_count):
 *             elem_typ = self.element_type_oids[i]
*/
  __pyx_t_7 = __pyx_v_self->record_desc;
  __Pyx_INCREF(__pyx_t_7);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_asyncpg); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Record); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyLong_FromSsize_t(__pyx_v_elem_count); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":299
 *             )
 *         result = self.record_desc.make_record(asyncpg.Record, elem_count)
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             elem_typ = self.element_type_oids[i]
 *             received_elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
*/
  __pyx_t_12 = __pyx_v_elem_count;
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "asyncpg/protocol/codecs/base.pyx":300
 *         result = self.record_desc.make_record(asyncpg.Record, elem_count)
 *         for i in range(elem_count):
 *             elem_typ = self.element_type_oids[i]             # <<<<<<<<<<<<<<
 *             received_elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
*/
    if (unlikely(__pyx_v_self->element_type_oids == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 300, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->element_type_oids, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_15 = __Pyx_PyLong_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_15 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_elem_typ = __pyx_t_15;

    /* "asyncpg/protocol/codecs/base.pyx":301
 *         for i in range(elem_count):
 *             elem_typ = self.element_type_oids[i]
 *             received_elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if received_elem_typ != elem_typ:
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 301, __pyx_L1_error)
    __pyx_v_received_elem_typ = ((uint32_t)unpack_int32(__pyx_t_1));

    /* "asyncpg/protocol/codecs/base.pyx":303
 *             received_elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if received_elem_typ != elem_typ:             # <<<<<<<<<<<<<<
 *                 raise exceptions.OutdatedSchemaCacheError(
 *                     'unexpected data type of composite type attribute {}: '
*/
    __pyx_t_4 = (__pyx_v_received_elem_typ != __pyx_v_elem_typ);
    if (unlikely(__pyx_t_4)) {

      /* "asyncpg/protocol/codecs/base.pyx":304
 * 
 *             if received_elem_typ != elem_typ:
 *                 raise exceptions.OutdatedSchemaCacheError(             # <<<<<<<<<<<<<<
 *                     'unexpected data type of composite type attribute {}: '
 *                     '{!r}, expected {!r}'
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_OutdatedSchemaCacheError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":307
 *                     'unexpected data type of composite type attribute {}: '
 *                     '{!r}, expected {!r}'
 *                         .format(             # <<<<<<<<<<<<<<
 *                             i,
 *                             BUILTIN_TYPE_OID_MAP.get(
*/
      __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_unexpected_data_type_of_composit;
      __Pyx_INCREF(__pyx_t_5);

      /* "asyncpg/protocol/codecs/base.pyx":308
 *                     '{!r}, expected {!r}'
 *                         .format(
 *                             i,             # <<<<<<<<<<<<<<
 *                             BUILTIN_TYPE_OID_MAP.get(
 *                                 received_elem_typ, received_elem_typ),
*/
      __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);

      /* "asyncpg/protocol/codecs/base.pyx":309
 *                         .format(
 *                             i,
 *                             BUILTIN_TYPE_OID_MAP.get(             # <<<<<<<<<<<<<<
 *                                 received_elem_typ, received_elem_typ),
 *                             BUILTIN_TYPE_OID_MAP.get(
*/
      __pyx_t_16 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 309, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":310
 *                             i,
 *                             BUILTIN_TYPE_OID_MAP.get(
 *                                 received_elem_typ, received_elem_typ),             # <<<<<<<<<<<<<<
 *                             BUILTIN_TYPE_OID_MAP.get(
 *                                 elem_typ, elem_typ)
*/
      __pyx_t_17 = __Pyx_PyLong_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_19 = __Pyx_PyLong_From_uint32_t(__pyx_v_received_elem_typ); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_18))) {
        __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_18);
        assert(__pyx_t_16);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_16, __pyx_t_17, __pyx_t_19};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }

      /* "asyncpg/protocol/codecs/base.pyx":311
 *                             BUILTIN_TYPE_OID_MAP.get(
 *                                 received_elem_typ, received_elem_typ),
 *                             BUILTIN_TYPE_OID_MAP.get(             # <<<<<<<<<<<<<<
 *                                 elem_typ, elem_typ)
 *                         ),
*/
      __pyx_t_19 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":312
 *                                 received_elem_typ, received_elem_typ),
 *                             BUILTIN_TYPE_OID_MAP.get(
 *                                 elem_typ, elem_typ)             # <<<<<<<<<<<<<<
 *                         ),
 *                     schema=self.schema,
*/
      __pyx_t_17 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_20 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_16);
        assert(__pyx_t_19);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_19);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_19, __pyx_t_17, __pyx_t_20};
        __pyx_t_18 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
      }
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_9, __pyx_t_8, __pyx_t_18};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }

      /* "asyncpg/protocol/codecs/base.pyx":316
 *                     schema=self.schema,
 *                     data_type=self.name,
 *                     position=i,             # <<<<<<<<<<<<<<
 *                 )
 * 
*/
      __pyx_t_18 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 3 : 0)] = {__pyx_t_10, __pyx_t_6};
        __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_schema, __pyx_v_self->schema, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(1, 304, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_data_type, __pyx_v_self->name, __pyx_t_8, __pyx_callargs+2, 1) < (0)) __PYX_ERR(1, 304, __pyx_L1_error)
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_position, __pyx_t_18, __pyx_t_8, __pyx_callargs+2, 2) < (0)) __PYX_ERR(1, 304, __pyx_L1_error)
        __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(1, 304, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":303
 *             received_elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if received_elem_typ != elem_typ:             # <<<<<<<<<<<<<<
 *                 raise exceptions.OutdatedSchemaCacheError(
 *                     'unexpected data type of composite type attribute {}: '
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":319
 *                 )
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if elem_len == -1:
 *                 elem = None
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 319, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/base.pyx":320
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
*/
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/base.pyx":321
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_codec = self.element_codecs[i]
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "asyncpg/protocol/codecs/base.pyx":320
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":323
 *                 elem = None
 *             else:
 *                 elem_codec = self.element_codecs[i]             # <<<<<<<<<<<<<<
 *                 elem = elem_codec.decode(
 *                     settings, frb_slice_from(&elem_buf, buf, elem_len))
*/
    /*else*/ {
      if (unlikely(__pyx_v_self->element_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 323, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->element_codecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 323, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":325
 *                 elem_codec = self.element_codecs[i]
 *                 elem = elem_codec.decode(
 *                     settings, frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
*/
      __pyx_t_21 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_21 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(1, 325, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":324
 *             else:
 *                 elem_codec = self.element_codecs[i]
 *                 elem = elem_codec.decode(             # <<<<<<<<<<<<<<
 *                     settings, frb_slice_from(&elem_buf, buf, elem_len))
 * 
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, __pyx_t_21); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L7:;

    /* "asyncpg/protocol/codecs/base.pyx":327
 *                     settings, frb_slice_from(&elem_buf, buf, elem_len))
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             recordcapi.ApgRecord_SET_ITEM(result, i, elem)
 * 
*/
    Py_INCREF(__pyx_v_elem);

    /* "asyncpg/protocol/codecs/base.pyx":328
 * 
 *             cpython.Py_INCREF(elem)
 *             recordcapi.ApgRecord_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
*/
    ApgRecord_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "asyncpg/protocol/codecs/base.pyx":330
 *             recordcapi.ApgRecord_SET_ITEM(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef decode_in_python(self, ConnectionSettings settings,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":274
 *                                  <void*>(<cpython.PyObject>self.element_codec))
 * 
 *     cdef decode_composite(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf):
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_composite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":332
 *         return result
 * 
 *     cdef decode_in_python(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_in_python", 0);

  /* "asyncpg/protocol/codecs/base.pyx":334
 *     cdef decode_in_python(self, ConnectionSettings settings,
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:             # <<<<<<<<<<<<<<
 *             if self.format == PG_FORMAT_BINARY:
 *                 data = pgproto.bytea_decode(settings, buf)
*/
  switch (__pyx_v_self->xformat) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT:

    /* "asyncpg/protocol/codecs/base.pyx":335
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 data = pgproto.bytea_decode(settings, buf)
 *             elif self.format == PG_FORMAT_TEXT:
*/
    switch (__pyx_v_self->format) {
      case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY:

      /* "asyncpg/protocol/codecs/base.pyx":336
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:
 *                 data = pgproto.bytea_decode(settings, buf)             # <<<<<<<<<<<<<<
 *             elif self.format == PG_FORMAT_TEXT:
 *                 data = pgproto.text_decode(settings, buf)
*/
      __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_data = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":335
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:
 *             if self.format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 data = pgproto.bytea_decode(settings, buf)
 *             elif self.format == PG_FORMAT_TEXT:
*/
      break;
      case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT:

      /* "asyncpg/protocol/codecs/base.pyx":338
 *                 data = pgproto.bytea_decode(settings, buf)
 *             elif self.format == PG_FORMAT_TEXT:
 *                 data = pgproto.text_decode(settings, buf)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise exceptions.InternalClientError(
*/
      __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_data = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":337
 *             if self.format == PG_FORMAT_BINARY:
 *                 data = pgproto.bytea_decode(settings, buf)
 *             elif self.format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                 data = pgproto.text_decode(settings, buf)
 *             else:
*/
      break;
      default:

      /* "asyncpg/protocol/codecs/base.pyx":340
 *                 data = pgproto.text_decode(settings, buf)
 *             else:
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":341
 *             else:
 *                 raise exceptions.InternalClientError(
 *                     'unexpected data format: {}'.format(self.format))             # <<<<<<<<<<<<<<
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:
*/
      __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_unexpected_data_format;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_self->format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 340, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(1, 340, __pyx_L1_error)
      break;
    }

    /* "asyncpg/protocol/codecs/base.pyx":334
 *     cdef decode_in_python(self, ConnectionSettings settings,
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:             # <<<<<<<<<<<<<<
 *             if self.format == PG_FORMAT_BINARY:
 *                 data = pgproto.bytea_decode(settings, buf)
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE:

    /* "asyncpg/protocol/codecs/base.pyx":343
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:             # <<<<<<<<<<<<<<
 *                 data = self.base_codec.decode(settings, buf)
 *             else:
*/
    __pyx_t_8 = (((PyObject *)__pyx_v_self->base_codec) != Py_None);
    if (__pyx_t_8) {

      /* "asyncpg/protocol/codecs/base.pyx":344
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:
 *                 data = self.base_codec.decode(settings, buf)             # <<<<<<<<<<<<<<
 *             else:
 *                 data = self.c_decoder(settings, buf)
*/
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_self->base_codec, __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_data = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":343
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:
 *             if self.base_codec is not None:             # <<<<<<<<<<<<<<
 *                 data = self.base_codec.decode(settings, buf)
 *             else:
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/codecs/base.pyx":346
 *                 data = self.base_codec.decode(settings, buf)
 *             else:
 *                 data = self.c_decoder(settings, buf)             # <<<<<<<<<<<<<<
 *         else:
 *             raise exceptions.InternalClientError(
*/
    /*else*/ {
      __pyx_t_1 = __pyx_v_self->c_decoder(__pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 346, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_data = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L3:;

    /* "asyncpg/protocol/codecs/base.pyx":342
 *                 raise exceptions.InternalClientError(
 *                     'unexpected data format: {}'.format(self.format))
 *         elif self.xformat == PG_XFORMAT_TUPLE:             # <<<<<<<<<<<<<<
 *             if self.base_codec is not None:
 *                 data = self.base_codec.decode(settings, buf)
*/
    break;
    default:

    /* "asyncpg/protocol/codecs/base.pyx":348
 *                 data = self.c_decoder(settings, buf)
 *         else:
 *             raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                 'unexpected exchange format: {}'.format(self.xformat))
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":349
 *         else:
 *             raise exceptions.InternalClientError(
 *                 'unexpected exchange format: {}'.format(self.xformat))             # <<<<<<<<<<<<<<
 * 
 *         return self.py_decoder(data)
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_unexpected_exchange_format;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_self->xformat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 349, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 348, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 348, __pyx_L1_error)
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":351
 *                 'unexpected exchange format: {}'.format(self.xformat))
 * 
 *         return self.py_decoder(data)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_v_self->py_decoder);
  __pyx_t_3 = __pyx_v_self->py_decoder; 
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":332
 *         return result
 * 
 *     cdef decode_in_python(self, ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf):
 *         if self.xformat == PG_XFORMAT_OBJECT:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.decode_in_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":353
 *         return self.py_decoder(data)
 * 
 *     cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.decoder(self, settings, buf)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 0);

  /* "asyncpg/protocol/codecs/base.pyx":354
 * 
 *     cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf):
 *         return self.decoder(self, settings, buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline has_encoder(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->decoder(__pyx_v_self, __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":353
 *         return self.py_decoder(data)
 * 
 *     cdef inline decode(self, ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.decoder(self, settings, buf)
 * 
*/

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

/* "asyncpg/protocol/codecs/base.pyx":356
 *         return self.decoder(self, settings, buf)
 * 
 *     cdef inline has_encoder(self):             # <<<<<<<<<<<<<<
 *         cdef Codec elem_codec
 * 
*/

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

  /* "asyncpg/protocol/codecs/base.pyx":359
 *         cdef Codec elem_codec
 * 
 *         if self.c_encoder is not NULL or self.py_encoder is not None:             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
  __pyx_t_2 = (__pyx_v_self->c_encoder != NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->py_encoder != Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":360
 * 
 *         if self.c_encoder is not NULL or self.py_encoder is not None:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         elif (
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":359
 *         cdef Codec elem_codec
 * 
 *         if self.c_encoder is not NULL or self.py_encoder is not None:             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":364
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
  switch (__pyx_v_self->type) {
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY:

    /* "asyncpg/protocol/codecs/base.pyx":363
 * 
 *         elif (
 *             self.type == CODEC_ARRAY             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_RANGE
 *             or self.type == CODEC_MULTIRANGE
*/
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE:

    /* "asyncpg/protocol/codecs/base.pyx":364
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE:

    /* "asyncpg/protocol/codecs/base.pyx":365
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
 *             or self.type == CODEC_MULTIRANGE             # <<<<<<<<<<<<<<
 *         ):
 *             return self.element_codec.has_encoder()
*/
    __pyx_t_1 = 1;

    /* "asyncpg/protocol/codecs/base.pyx":364
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":362
 *             return True
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
*/
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":367
 *             or self.type == CODEC_MULTIRANGE
 *         ):
 *             return self.element_codec.has_encoder()             # <<<<<<<<<<<<<<
 * 
 *         elif self.type == CODEC_COMPOSITE:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":362
 *             return True
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":369
 *             return self.element_codec.has_encoder()
 * 
 *         elif self.type == CODEC_COMPOSITE:             # <<<<<<<<<<<<<<
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_encoder():
*/
  __pyx_t_1 = (__pyx_v_self->type == __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":370
 * 
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:             # <<<<<<<<<<<<<<
 *                 if not elem_codec.has_encoder():
 *                     return False
*/
    if (unlikely(__pyx_v_self->element_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 370, __pyx_L1_error)
    }
    __pyx_t_3 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 370, __pyx_L1_error)
        #endif
        if (__pyx_t_4 >= __pyx_temp) break;
      }
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_4;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 370, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":371
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_encoder():             # <<<<<<<<<<<<<<
 *                     return False
 *             return True
*/
      __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 371, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 371, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/base.pyx":372
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_encoder():
 *                     return False             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "asyncpg/protocol/codecs/base.pyx":371
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_encoder():             # <<<<<<<<<<<<<<
 *                     return False
 *             return True
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":370
 * 
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:             # <<<<<<<<<<<<<<
 *                 if not elem_codec.has_encoder():
 *                     return False
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":373
 *                 if not elem_codec.has_encoder():
 *                     return False
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":369
 *             return self.element_codec.has_encoder()
 * 
 *         elif self.type == CODEC_COMPOSITE:             # <<<<<<<<<<<<<<
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_encoder():
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":376
 * 
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cdef has_decoder(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/codecs/base.pyx":356
 *         return self.decoder(self, settings, buf)
 * 
 *     cdef inline has_encoder(self):             # <<<<<<<<<<<<<<
 *         cdef Codec elem_codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.has_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":378
 *             return False
 * 
 *     cdef has_decoder(self):             # <<<<<<<<<<<<<<
 *         cdef Codec elem_codec
 * 
*/

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

  /* "asyncpg/protocol/codecs/base.pyx":381
 *         cdef Codec elem_codec
 * 
 *         if self.c_decoder is not NULL or self.py_decoder is not None:             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
  __pyx_t_2 = (__pyx_v_self->c_decoder != NULL);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->py_decoder != Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":382
 * 
 *         if self.c_decoder is not NULL or self.py_decoder is not None:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         elif (
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":381
 *         cdef Codec elem_codec
 * 
 *         if self.c_decoder is not NULL or self.py_decoder is not None:             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":386
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
  switch (__pyx_v_self->type) {
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY:

    /* "asyncpg/protocol/codecs/base.pyx":385
 * 
 *         elif (
 *             self.type == CODEC_ARRAY             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_RANGE
 *             or self.type == CODEC_MULTIRANGE
*/
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE:

    /* "asyncpg/protocol/codecs/base.pyx":386
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
    case __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE:

    /* "asyncpg/protocol/codecs/base.pyx":387
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
 *             or self.type == CODEC_MULTIRANGE             # <<<<<<<<<<<<<<
 *         ):
 *             return self.element_codec.has_decoder()
*/
    __pyx_t_1 = 1;

    /* "asyncpg/protocol/codecs/base.pyx":386
 *         elif (
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE             # <<<<<<<<<<<<<<
 *             or self.type == CODEC_MULTIRANGE
 *         ):
*/
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":384
 *             return True
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
*/
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":389
 *             or self.type == CODEC_MULTIRANGE
 *         ):
 *             return self.element_codec.has_decoder()             # <<<<<<<<<<<<<<
 * 
 *         elif self.type == CODEC_COMPOSITE:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_self->element_codec); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":384
 *             return True
 * 
 *         elif (             # <<<<<<<<<<<<<<
 *             self.type == CODEC_ARRAY
 *             or self.type == CODEC_RANGE
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":391
 *             return self.element_codec.has_decoder()
 * 
 *         elif self.type == CODEC_COMPOSITE:             # <<<<<<<<<<<<<<
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_decoder():
*/
  __pyx_t_1 = (__pyx_v_self->type == __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":392
 * 
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:             # <<<<<<<<<<<<<<
 *                 if not elem_codec.has_decoder():
 *                     return False
*/
    if (unlikely(__pyx_v_self->element_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 392, __pyx_L1_error)
    }
    __pyx_t_3 = __pyx_v_self->element_codecs; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 392, __pyx_L1_error)
        #endif
        if (__pyx_t_4 >= __pyx_temp) break;
      }
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_4;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 392, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":393
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_decoder():             # <<<<<<<<<<<<<<
 *                     return False
 *             return True
*/
      __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 393, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/base.pyx":394
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_decoder():
 *                     return False             # <<<<<<<<<<<<<<
 *             return True
 * 
*/
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "asyncpg/protocol/codecs/base.pyx":393
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_decoder():             # <<<<<<<<<<<<<<
 *                     return False
 *             return True
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":392
 * 
 *         elif self.type == CODEC_COMPOSITE:
 *             for elem_codec in self.element_codecs:             # <<<<<<<<<<<<<<
 *                 if not elem_codec.has_decoder():
 *                     return False
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":395
 *                 if not elem_codec.has_decoder():
 *                     return False
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":391
 *             return self.element_codec.has_decoder()
 * 
 *         elif self.type == CODEC_COMPOSITE:             # <<<<<<<<<<<<<<
 *             for elem_codec in self.element_codecs:
 *                 if not elem_codec.has_decoder():
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":398
 * 
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     cdef is_binary(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/codecs/base.pyx":378
 *             return False
 * 
 *     cdef has_decoder(self):             # <<<<<<<<<<<<<<
 *         cdef Codec elem_codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.has_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":400
 *             return False
 * 
 *     cdef is_binary(self):             # <<<<<<<<<<<<<<
 *         return self.format == PG_FORMAT_BINARY
 * 
*/

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

  /* "asyncpg/protocol/codecs/base.pyx":401
 * 
 *     cdef is_binary(self):
 *         return self.format == PG_FORMAT_BINARY             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":400
 *             return False
 * 
 *     cdef is_binary(self):             # <<<<<<<<<<<<<<
 *         return self.format == PG_FORMAT_BINARY
 * 
*/

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

/* "asyncpg/protocol/codecs/base.pyx":403
 *         return self.format == PG_FORMAT_BINARY
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<Codec oid={} elem_oid={} core={}>'.format(
 *             self.oid,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Codec_2__repr__(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "asyncpg/protocol/codecs/base.pyx":404
 * 
 *     def __repr__(self):
 *         return '<Codec oid={} elem_oid={} core={}>'.format(             # <<<<<<<<<<<<<<
 *             self.oid,
 *             'NA' if self.element_codec is None else self.element_codec.oid,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u_Codec_oid_elem_oid_core;
  __Pyx_INCREF(__pyx_t_2);

  /* "asyncpg/protocol/codecs/base.pyx":405
 *     def __repr__(self):
 *         return '<Codec oid={} elem_oid={} core={}>'.format(
 *             self.oid,             # <<<<<<<<<<<<<<
 *             'NA' if self.element_codec is None else self.element_codec.oid,
 *             has_core_codec(self.oid))
*/
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_self->oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "asyncpg/protocol/codecs/base.pyx":406
 *         return '<Codec oid={} elem_oid={} core={}>'.format(
 *             self.oid,
 *             'NA' if self.element_codec is None else self.element_codec.oid,             # <<<<<<<<<<<<<<
 *             has_core_codec(self.oid))
 * 
*/
  __pyx_t_5 = (((PyObject *)__pyx_v_self->element_codec) == Py_None);
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_NA);
    __pyx_t_4 = __pyx_mstate_global->__pyx_n_u_NA;
  } else {
    __pyx_t_6 = __Pyx_PyLong_From_uint32_t(__pyx_v_self->element_codec->oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __pyx_t_6;
    __pyx_t_6 = 0;
  }

  /* "asyncpg/protocol/codecs/base.pyx":407
 *             self.oid,
 *             'NA' if self.element_codec is None else self.element_codec.oid,
 *             has_core_codec(self.oid))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_t_7 = __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(__pyx_v_self->oid); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 407, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":403
 *         return self.format == PG_FORMAT_BINARY
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<Codec oid={} elem_oid={} core={}>'.format(
 *             self.oid,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":409
 *             has_core_codec(self.oid))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_array_codec(uint32_t oid,
 *                                str name,
*/

static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec, Py_UCS4 __pyx_v_element_delimiter) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_array_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":416
 *                                Py_UCS4 element_delimiter):
 *         cdef Codec codec
 *         codec = Codec(oid)             # <<<<<<<<<<<<<<
 *         codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format,
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 416, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":417
 *         cdef Codec codec
 *         codec = Codec(oid)
 *         codec.init(name, schema, 'array', CODEC_ARRAY, element_codec.format,             # <<<<<<<<<<<<<<
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    element_codec, None, None, None, element_delimiter)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_array, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_ARRAY, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), __pyx_v_element_delimiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":420
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    element_codec, None, None, None, element_delimiter)
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":409
 *             has_core_codec(self.oid))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_array_codec(uint32_t oid,
 *                                str name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_array_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":422
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_range_codec(uint32_t oid,
 *                                str name,
*/

static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_range_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":428
 *                                Codec element_codec):
 *         cdef Codec codec
 *         codec = Codec(oid)             # <<<<<<<<<<<<<<
 *         codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format,
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 428, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":429
 *         cdef Codec codec
 *         codec = Codec(oid)
 *         codec.init(name, schema, 'range', CODEC_RANGE, element_codec.format,             # <<<<<<<<<<<<<<
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    element_codec, None, None, None, 0)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_range, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_RANGE, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":432
 *                    PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    element_codec, None, None, None, 0)
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":422
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_range_codec(uint32_t oid,
 *                                str name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_range_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":434
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_multirange_codec(uint32_t oid,
 *                                     str name,
*/

static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_element_codec) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_multirange_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":440
 *                                     Codec element_codec):
 *         cdef Codec codec
 *         codec = Codec(oid)             # <<<<<<<<<<<<<<
 *         codec.init(name, schema, 'multirange', CODEC_MULTIRANGE,
 *                    element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 440, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":441
 *         cdef Codec codec
 *         codec = Codec(oid)
 *         codec.init(name, schema, 'multirange', CODEC_MULTIRANGE,             # <<<<<<<<<<<<<<
 *                    element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None,
 *                    None, None, element_codec, None, None, None, 0)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_multirange, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_MULTIRANGE, __pyx_v_element_codec->format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, __pyx_v_element_codec, ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":444
 *                    element_codec.format, PG_XFORMAT_OBJECT, NULL, NULL, None,
 *                    None, None, element_codec, None, None, None, 0)
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":434
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_multirange_codec(uint32_t oid,
 *                                     str name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_multirange_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":446
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_composite_codec(uint32_t oid,
 *                                    str name,
*/

static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, PyObject *__pyx_v_element_codecs, PyObject *__pyx_v_element_type_oids, PyObject *__pyx_v_element_names) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_composite_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":455
 *                                    object element_names):
 *         cdef Codec codec
 *         codec = Codec(oid)             # <<<<<<<<<<<<<<
 *         codec.init(name, schema, 'composite', CODEC_COMPOSITE,
 *                    format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 455, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":456
 *         cdef Codec codec
 *         codec = Codec(oid)
 *         codec.init(name, schema, 'composite', CODEC_COMPOSITE,             # <<<<<<<<<<<<<<
 *                    format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    None, element_type_oids, element_names, element_codecs, 0)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_composite, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_COMPOSITE, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, NULL, NULL, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), __pyx_v_element_type_oids, __pyx_v_element_names, __pyx_v_element_codecs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":459
 *                    format, PG_XFORMAT_OBJECT, NULL, NULL, None, None, None,
 *                    None, element_type_oids, element_names, element_codecs, 0)
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":446
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_composite_codec(uint32_t oid,
 *                                    str name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_composite_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":461
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_python_codec(uint32_t oid,
 *                                 str name,
*/

static struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema, PyObject *__pyx_v_kind, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_python_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":474
 *                                 ClientExchangeFormat xformat):
 *         cdef Codec codec
 *         codec = Codec(oid)             # <<<<<<<<<<<<<<
 *         codec.init(name, schema, kind, CODEC_PY, format, xformat,
 *                    c_encoder, c_decoder, base_codec, encoder, decoder,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 474, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":475
 *         cdef Codec codec
 *         codec = Codec(oid)
 *         codec.init(name, schema, kind, CODEC_PY, format, xformat,             # <<<<<<<<<<<<<<
 *                    c_encoder, c_decoder, base_codec, encoder, decoder,
 *                    None, None, None, None, 0)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_v_schema, __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_PY, __pyx_v_format, __pyx_v_xformat, __pyx_v_c_encoder, __pyx_v_c_decoder, __pyx_v_base_codec, __pyx_v_encoder, __pyx_v_decoder, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":478
 *                    c_encoder, c_decoder, base_codec, encoder, decoder,
 *                    None, None, None, None, 0)
 *         return codec             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":461
 *         return codec
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Codec new_python_codec(uint32_t oid,
 *                                 str name,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.new_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_4__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Codec_6__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Codec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":482
 * 
 * # Encode callback for arrays
 * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj, const void *arg):
 *     return (<Codec>arg).encode(settings, buf, obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_encode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("codec_encode_func_ex", 0);

  /* "asyncpg/protocol/codecs/base.pyx":484
 * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf,
 *                           object obj, const void *arg):
 *     return (<Codec>arg).encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_arg), __pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":482
 * 
 * # Encode callback for arrays
 * cdef codec_encode_func_ex(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj, const void *arg):
 *     return (<Codec>arg).encode(settings, buf, obj)
*/

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

/* "asyncpg/protocol/codecs/base.pyx":488
 * 
 * # Decode callback for arrays
 * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                           const void *arg):
 *     return (<Codec>arg).decode(settings, buf)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_codec_decode_func_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("codec_decode_func_ex", 0);

  /* "asyncpg/protocol/codecs/base.pyx":490
 * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf,
 *                           const void *arg):
 *     return (<Codec>arg).decode(settings, buf)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_arg), __pyx_v_settings, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":488
 * 
 * # Decode callback for arrays
 * cdef codec_decode_func_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                           const void *arg):
 *     return (<Codec>arg).decode(settings, buf)
*/

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

/* "asyncpg/protocol/codecs/base.pyx":493
 * 
 * 
 * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl:             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t oid = 0
*/

static uint32_t __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(PyObject *__pyx_v_val) {
  int64_t __pyx_v_oid;
  int __pyx_v_overflow;
  uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PY_LONG_LONG __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  uint32_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pylong_as_oid", 0);

  /* "asyncpg/protocol/codecs/base.pyx":495
 * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl:
 *     cdef:
 *         int64_t oid = 0             # <<<<<<<<<<<<<<
 *         bint overflow = False
 * 
*/
  __pyx_v_oid = 0;

  /* "asyncpg/protocol/codecs/base.pyx":496
 *     cdef:
 *         int64_t oid = 0
 *         bint overflow = False             # <<<<<<<<<<<<<<
 * 
 *     try:
*/
  __pyx_v_overflow = 0;

  /* "asyncpg/protocol/codecs/base.pyx":498
 *         bint overflow = False
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         oid = cpython.PyLong_AsLongLong(val)
 *     except OverflowError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/codecs/base.pyx":499
 * 
 *     try:
 *         oid = cpython.PyLong_AsLongLong(val)             # <<<<<<<<<<<<<<
 *     except OverflowError:
 *         overflow = True
*/
      __pyx_t_4 = PyLong_AsLongLong(__pyx_v_val); if (unlikely(__pyx_t_4 == ((PY_LONG_LONG)-1LL) && PyErr_Occurred())) __PYX_ERR(1, 499, __pyx_L3_error)
      __pyx_v_oid = __pyx_t_4;

      /* "asyncpg/protocol/codecs/base.pyx":498
 *         bint overflow = False
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         oid = cpython.PyLong_AsLongLong(val)
 *     except OverflowError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "asyncpg/protocol/codecs/base.pyx":500
 *     try:
 *         oid = cpython.PyLong_AsLongLong(val)
 *     except OverflowError:             # <<<<<<<<<<<<<<
 *         overflow = True
 * 
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_OverflowError))));
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);

      /* "asyncpg/protocol/codecs/base.pyx":501
 *         oid = cpython.PyLong_AsLongLong(val)
 *     except OverflowError:
 *         overflow = True             # <<<<<<<<<<<<<<
 * 
 *     if overflow or (oid < 0 or oid > UINT32_MAX):
*/
      __pyx_v_overflow = 1;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/codecs/base.pyx":498
 *         bint overflow = False
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         oid = cpython.PyLong_AsLongLong(val)
 *     except OverflowError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/codecs/base.pyx":503
 *         overflow = True
 * 
 *     if overflow or (oid < 0 or oid > UINT32_MAX):             # <<<<<<<<<<<<<<
 *         raise OverflowError('OID value too large: {!r}'.format(val))
 * 
*/
  if (!__pyx_v_overflow) {
  } else {
    __pyx_t_6 = __pyx_v_overflow;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_oid < 0);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_oid > UINT32_MAX);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L12_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "asyncpg/protocol/codecs/base.pyx":504
 * 
 *     if overflow or (oid < 0 or oid > UINT32_MAX):
 *         raise OverflowError('OID value too large: {!r}'.format(val))             # <<<<<<<<<<<<<<
 * 
 *     return <uint32_t>val
*/
    __pyx_t_9 = NULL;
    __pyx_t_11 = __pyx_mstate_global->__pyx_kp_u_OID_value_too_large_r;
    __Pyx_INCREF(__pyx_t_11);
    __pyx_t_12 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_val};
      __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(1, 504, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":503
 *         overflow = True
 * 
 *     if overflow or (oid < 0 or oid > UINT32_MAX):             # <<<<<<<<<<<<<<
 *         raise OverflowError('OID value too large: {!r}'.format(val))
 * 
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":506
 *         raise OverflowError('OID value too large: {!r}'.format(val))
 * 
 *     return <uint32_t>val             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_13 = __Pyx_PyLong_As_uint32_t(__pyx_v_val); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 506, __pyx_L1_error)
  __pyx_r = ((uint32_t)__pyx_t_13);
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":493
 * 
 * 
 * cdef uint32_t pylong_as_oid(val) except? 0xFFFFFFFFl:             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t oid = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.pylong_as_oid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0xFFFFFFFFL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":510
 * 
 * cdef class DataCodecConfig:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Codec instance cache for derived types:
 *         # composites, arrays, ranges, domains and their combinations.
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/codecs/base.pyx":513
 *         # Codec instance cache for derived types:
 *         # composites, arrays, ranges, domains and their combinations.
 *         self._derived_type_codecs = {}             # <<<<<<<<<<<<<<
 *         # Codec instances set up by the user for the connection.
 *         self._custom_type_codecs = {}
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_derived_type_codecs);
  __Pyx_DECREF(__pyx_v_self->_derived_type_codecs);
  __pyx_v_self->_derived_type_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":515
 *         self._derived_type_codecs = {}
 *         # Codec instances set up by the user for the connection.
 *         self._custom_type_codecs = {}             # <<<<<<<<<<<<<<
 * 
 *     def add_types(self, types):
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_custom_type_codecs);
  __Pyx_DECREF(__pyx_v_self->_custom_type_codecs);
  __pyx_v_self->_custom_type_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":510
 * 
 * cdef class DataCodecConfig:
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         # Codec instance cache for derived types:
 *         # composites, arrays, ranges, domains and their combinations.
*/

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

/* "asyncpg/protocol/codecs/base.pyx":517
 *         self._custom_type_codecs = {}
 * 
 *     def add_types(self, types):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec elem_codec
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types = {"add_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_types = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_types (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_types,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 517, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_types", 0) < (0)) __PYX_ERR(1, 517, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_types", 1, 1, 1, i); __PYX_ERR(1, 517, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 517, __pyx_L3_error)
    }
    __pyx_v_types = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_types", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 517, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_types);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_2add_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_types) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0;
  PyObject *__pyx_v_comp_elem_codecs = 0;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_elem_format;
  int __pyx_v_has_text_elements;
  Py_UCS4 __pyx_v_elem_delim;
  PyObject *__pyx_v_ti = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_schema = NULL;
  PyObject *__pyx_v_array_element_oid = NULL;
  PyObject *__pyx_v_range_subtype_oid = NULL;
  PyObject *__pyx_v_comp_type_attrs = NULL;
  PyObject *__pyx_v_base_type = NULL;
  PyObject *__pyx_v_typoid = NULL;
  PyObject *__pyx_v_element_names = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_attrname = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  uint32_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  Py_UCS4 __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_types", 0);

  /* "asyncpg/protocol/codecs/base.pyx":526
 *             Py_UCS4 elem_delim
 * 
 *         for ti in types:             # <<<<<<<<<<<<<<
 *             oid = ti['oid']
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_types)) || PyTuple_CheckExact(__pyx_v_types)) {
    __pyx_t_1 = __pyx_v_types; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 526, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 526, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 526, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 526, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 526, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_ti, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":527
 * 
 *         for ti in types:
 *             oid = ti['oid']             # <<<<<<<<<<<<<<
 * 
 *             if self.get_codec(oid, PG_FORMAT_ANY) is not None:
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_oid); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":529
 *             oid = ti['oid']
 * 
 *             if self.get_codec(oid, PG_FORMAT_ANY) is not None:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
    __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":530
 * 
 *             if self.get_codec(oid, PG_FORMAT_ANY) is not None:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             name = ti['name']
*/
      goto __pyx_L3_continue;

      /* "asyncpg/protocol/codecs/base.pyx":529
 *             oid = ti['oid']
 * 
 *             if self.get_codec(oid, PG_FORMAT_ANY) is not None:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":532
 *                 continue
 * 
 *             name = ti['name']             # <<<<<<<<<<<<<<
 *             schema = ti['ns']
 *             array_element_oid = ti['elemtype']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":533
 * 
 *             name = ti['name']
 *             schema = ti['ns']             # <<<<<<<<<<<<<<
 *             array_element_oid = ti['elemtype']
 *             range_subtype_oid = ti['range_subtype']
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_schema, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":534
 *             name = ti['name']
 *             schema = ti['ns']
 *             array_element_oid = ti['elemtype']             # <<<<<<<<<<<<<<
 *             range_subtype_oid = ti['range_subtype']
 *             if ti['attrtypoids']:
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_elemtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_array_element_oid, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":535
 *             schema = ti['ns']
 *             array_element_oid = ti['elemtype']
 *             range_subtype_oid = ti['range_subtype']             # <<<<<<<<<<<<<<
 *             if ti['attrtypoids']:
 *                 comp_type_attrs = tuple(ti['attrtypoids'])
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_range_subtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_range_subtype_oid, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":536
 *             array_element_oid = ti['elemtype']
 *             range_subtype_oid = ti['range_subtype']
 *             if ti['attrtypoids']:             # <<<<<<<<<<<<<<
 *                 comp_type_attrs = tuple(ti['attrtypoids'])
 *             else:
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 536, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":537
 *             range_subtype_oid = ti['range_subtype']
 *             if ti['attrtypoids']:
 *                 comp_type_attrs = tuple(ti['attrtypoids'])             # <<<<<<<<<<<<<<
 *             else:
 *                 comp_type_attrs = None
*/
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_attrtypoids); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_comp_type_attrs, ((PyObject*)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":536
 *             array_element_oid = ti['elemtype']
 *             range_subtype_oid = ti['range_subtype']
 *             if ti['attrtypoids']:             # <<<<<<<<<<<<<<
 *                 comp_type_attrs = tuple(ti['attrtypoids'])
 *             else:
*/
      goto __pyx_L6;
    }

    /* "asyncpg/protocol/codecs/base.pyx":539
 *                 comp_type_attrs = tuple(ti['attrtypoids'])
 *             else:
 *                 comp_type_attrs = None             # <<<<<<<<<<<<<<
 *             base_type = ti['basetype']
 * 
*/
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_comp_type_attrs, ((PyObject*)Py_None));
    }
    __pyx_L6:;

    /* "asyncpg/protocol/codecs/base.pyx":540
 *             else:
 *                 comp_type_attrs = None
 *             base_type = ti['basetype']             # <<<<<<<<<<<<<<
 * 
 *             if array_element_oid:
*/
    __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_basetype); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_base_type, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":542
 *             base_type = ti['basetype']
 * 
 *             if array_element_oid:             # <<<<<<<<<<<<<<
 *                 # Array type (note, there is no separate 'kind' for arrays)
 * 
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_array_element_oid); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 542, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":546
 * 
 *                 # Canonicalize type name to "elemtype[]"
 *                 if name.startswith('_'):             # <<<<<<<<<<<<<<
 *                     name = name[1:]
 *                 name = '{}[]'.format(name)
*/
      __pyx_t_4 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u__2};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 546, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 546, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/base.pyx":547
 *                 # Canonicalize type name to "elemtype[]"
 *                 if name.startswith('_'):
 *                     name = name[1:]             # <<<<<<<<<<<<<<
 *                 name = '{}[]'.format(name)
 * 
*/
        __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_name, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 547, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":546
 * 
 *                 # Canonicalize type name to "elemtype[]"
 *                 if name.startswith('_'):             # <<<<<<<<<<<<<<
 *                     name = name[1:]
 *                 name = '{}[]'.format(name)
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":548
 *                 if name.startswith('_'):
 *                     name = name[1:]
 *                 name = '{}[]'.format(name)             # <<<<<<<<<<<<<<
 * 
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)
*/
      __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u__3;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_name};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":550
 *                 name = '{}[]'.format(name)
 * 
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_array_element_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 550, __pyx_L1_error)
      __pyx_t_7 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":551
 * 
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         array_element_oid, ti['elemtype_name'], schema)
*/
      __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/base.pyx":552
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         array_element_oid, ti['elemtype_name'], schema)
 * 
*/
        __pyx_t_4 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_4);

        /* "asyncpg/protocol/codecs/base.pyx":553
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
 *                         array_element_oid, ti['elemtype_name'], schema)             # <<<<<<<<<<<<<<
 * 
 *                 elem_delim = <Py_UCS4>ti['elemdelim'][0]
*/
        __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_elemtype_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 553, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_array_element_oid, __pyx_t_9, __pyx_v_schema};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 552, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }

        /* "asyncpg/protocol/codecs/base.pyx":552
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         array_element_oid, ti['elemtype_name'], schema)
 * 
*/
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 552, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7));
        __pyx_t_7 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":551
 * 
 *                 elem_codec = self.get_codec(array_element_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         array_element_oid, ti['elemtype_name'], schema)
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":555
 *                         array_element_oid, ti['elemtype_name'], schema)
 * 
 *                 elem_delim = <Py_UCS4>ti['elemdelim'][0]             # <<<<<<<<<<<<<<
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
*/
      __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_elemdelim); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = __Pyx_PyObject_AsPy_UCS4(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_UCS4)-1) && PyErr_Occurred())) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_elem_delim = ((Py_UCS4)__pyx_t_10);

      /* "asyncpg/protocol/codecs/base.pyx":559
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
 *                     Codec.new_array_codec(
 *                         oid, name, schema, elem_codec, elem_delim)             # <<<<<<<<<<<<<<
 * 
 *             elif ti['kind'] == b'c':
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L1_error)
      __pyx_t_9 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_9);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_9)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(1, 559, __pyx_L1_error)
      __pyx_t_7 = __pyx_v_schema;
      __Pyx_INCREF(__pyx_t_7);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(1, 559, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":558
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
 *                     Codec.new_array_codec(             # <<<<<<<<<<<<<<
 *                         oid, name, schema, elem_codec, elem_delim)
 * 
*/
      __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec(__pyx_t_5, ((PyObject*)__pyx_t_9), ((PyObject*)__pyx_t_7), __pyx_v_elem_codec, __pyx_v_elem_delim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":557
 *                 elem_delim = <Py_UCS4>ti['elemdelim'][0]
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \             # <<<<<<<<<<<<<<
 *                     Codec.new_array_codec(
 *                         oid, name, schema, elem_codec, elem_delim)
*/
      if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 557, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_oid);
      __Pyx_GIVEREF(__pyx_v_oid);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
      __pyx_t_7 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_9, __pyx_t_4) < 0))) __PYX_ERR(1, 557, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":542
 *             base_type = ti['basetype']
 * 
 *             if array_element_oid:             # <<<<<<<<<<<<<<
 *                 # Array type (note, there is no separate 'kind' for arrays)
 * 
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":561
 *                         oid, name, schema, elem_codec, elem_delim)
 * 
 *             elif ti['kind'] == b'c':             # <<<<<<<<<<<<<<
 *                 # Composite type
 * 
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_b_c, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 561, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":564
 *                 # Composite type
 * 
 *                 if not comp_type_attrs:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing field types for composite {oid}')
*/
      if (__pyx_v_comp_type_attrs == Py_None) __pyx_t_6 = 0;
      else
      {
        Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_v_comp_type_attrs);
        if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(1, 564, __pyx_L1_error)
        __pyx_t_6 = (__pyx_temp != 0);
      }

      __pyx_t_11 = (!__pyx_t_6);
      if (unlikely(__pyx_t_11)) {

        /* "asyncpg/protocol/codecs/base.pyx":565
 * 
 *                 if not comp_type_attrs:
 *                     raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                         f'type record missing field types for composite {oid}')
 * 
*/
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 565, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":566
 *                 if not comp_type_attrs:
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing field types for composite {oid}')             # <<<<<<<<<<<<<<
 * 
 *                 comp_elem_codecs = []
*/
        __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_field_types, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_13};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 565, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 565, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":564
 *                 # Composite type
 * 
 *                 if not comp_type_attrs:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing field types for composite {oid}')
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":568
 *                         f'type record missing field types for composite {oid}')
 * 
 *                 comp_elem_codecs = []             # <<<<<<<<<<<<<<
 *                 has_text_elements = False
 * 
*/
      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_comp_elem_codecs, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":569
 * 
 *                 comp_elem_codecs = []
 *                 has_text_elements = False             # <<<<<<<<<<<<<<
 * 
 *                 for typoid in comp_type_attrs:
*/
      __pyx_v_has_text_elements = 0;

      /* "asyncpg/protocol/codecs/base.pyx":571
 *                 has_text_elements = False
 * 
 *                 for typoid in comp_type_attrs:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)
 *                     if elem_codec is None:
*/
      if (unlikely(__pyx_v_comp_type_attrs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        __PYX_ERR(1, 571, __pyx_L1_error)
      }
      __pyx_t_4 = __pyx_v_comp_type_attrs; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_14 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 571, __pyx_L1_error)
          #endif
          if (__pyx_t_14 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14));
        #else
        __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_14);
        #endif
        ++__pyx_t_14;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 571, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_v_typoid, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":572
 * 
 *                 for typoid in comp_type_attrs:
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                     if elem_codec is None:
 *                         raise exceptions.InternalClientError(
*/
        __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_typoid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 572, __pyx_L1_error)
        __pyx_t_12 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_12));
        __pyx_t_12 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":573
 *                 for typoid in comp_type_attrs:
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)
 *                     if elem_codec is None:             # <<<<<<<<<<<<<<
 *                         raise exceptions.InternalClientError(
 *                             f'no codec for composite attribute type {typoid}')
*/
        __pyx_t_11 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
        if (unlikely(__pyx_t_11)) {

          /* "asyncpg/protocol/codecs/base.pyx":574
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)
 *                     if elem_codec is None:
 *                         raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                             f'no codec for composite attribute type {typoid}')
 *                     if elem_codec.format is PG_FORMAT_TEXT:
*/
          __pyx_t_13 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 574, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 574, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "asyncpg/protocol/codecs/base.pyx":575
 *                     if elem_codec is None:
 *                         raise exceptions.InternalClientError(
 *                             f'no codec for composite attribute type {typoid}')             # <<<<<<<<<<<<<<
 *                     if elem_codec.format is PG_FORMAT_TEXT:
 *                         has_text_elements = True
*/
          __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_typoid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_no_codec_for_composite_attribute, __pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_8 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
            assert(__pyx_t_13);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
            __pyx_t_8 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_15};
            __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 574, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_Raise(__pyx_t_12, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(1, 574, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/base.pyx":573
 *                 for typoid in comp_type_attrs:
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)
 *                     if elem_codec is None:             # <<<<<<<<<<<<<<
 *                         raise exceptions.InternalClientError(
 *                             f'no codec for composite attribute type {typoid}')
*/
        }

        /* "asyncpg/protocol/codecs/base.pyx":576
 *                         raise exceptions.InternalClientError(
 *                             f'no codec for composite attribute type {typoid}')
 *                     if elem_codec.format is PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                         has_text_elements = True
 *                     comp_elem_codecs.append(elem_codec)
*/
        __pyx_t_11 = (__pyx_v_elem_codec->format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT);
        if (__pyx_t_11) {

          /* "asyncpg/protocol/codecs/base.pyx":577
 *                             f'no codec for composite attribute type {typoid}')
 *                     if elem_codec.format is PG_FORMAT_TEXT:
 *                         has_text_elements = True             # <<<<<<<<<<<<<<
 *                     comp_elem_codecs.append(elem_codec)
 * 
*/
          __pyx_v_has_text_elements = 1;

          /* "asyncpg/protocol/codecs/base.pyx":576
 *                         raise exceptions.InternalClientError(
 *                             f'no codec for composite attribute type {typoid}')
 *                     if elem_codec.format is PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                         has_text_elements = True
 *                     comp_elem_codecs.append(elem_codec)
*/
        }

        /* "asyncpg/protocol/codecs/base.pyx":578
 *                     if elem_codec.format is PG_FORMAT_TEXT:
 *                         has_text_elements = True
 *                     comp_elem_codecs.append(elem_codec)             # <<<<<<<<<<<<<<
 * 
 *                 element_names = collections.OrderedDict()
*/
        __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_comp_elem_codecs, ((PyObject *)__pyx_v_elem_codec)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(1, 578, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":571
 *                 has_text_elements = False
 * 
 *                 for typoid in comp_type_attrs:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.get_codec(typoid, PG_FORMAT_ANY)
 *                     if elem_codec is None:
*/
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":580
 *                     comp_elem_codecs.append(elem_codec)
 * 
 *                 element_names = collections.OrderedDict()             # <<<<<<<<<<<<<<
 *                 for i, attrname in enumerate(ti['attrnames']):
 *                     element_names[attrname] = i
*/
      __pyx_t_12 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_15))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
        assert(__pyx_t_12);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 580, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_element_names, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":581
 * 
 *                 element_names = collections.OrderedDict()
 *                 for i, attrname in enumerate(ti['attrnames']):             # <<<<<<<<<<<<<<
 *                     element_names[attrname] = i
 * 
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
      __pyx_t_4 = __pyx_mstate_global->__pyx_int_0;
      __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_attrnames); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (likely(PyList_CheckExact(__pyx_t_15)) || PyTuple_CheckExact(__pyx_t_15)) {
        __pyx_t_12 = __pyx_t_15; __Pyx_INCREF(__pyx_t_12);
        __pyx_t_14 = 0;
        __pyx_t_17 = NULL;
      } else {
        __pyx_t_14 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 581, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 581, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      for (;;) {
        if (likely(!__pyx_t_17)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 581, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            __pyx_t_15 = __Pyx_PyList_GetItemRefFast(__pyx_t_12, __pyx_t_14, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_14;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 581, __pyx_L1_error)
              #endif
              if (__pyx_t_14 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_15 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_14));
            #else
            __pyx_t_15 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_14);
            #endif
            ++__pyx_t_14;
          }
          if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error)
        } else {
          __pyx_t_15 = __pyx_t_17(__pyx_t_12);
          if (unlikely(!__pyx_t_15)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 581, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_XDECREF_SET(__pyx_v_attrname, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
        __pyx_t_15 = __Pyx_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 581, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_4);
        __pyx_t_4 = __pyx_t_15;
        __pyx_t_15 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":582
 *                 element_names = collections.OrderedDict()
 *                 for i, attrname in enumerate(ti['attrnames']):
 *                     element_names[attrname] = i             # <<<<<<<<<<<<<<
 * 
 *                 # If at least one element is text-encoded, we must
*/
        if (unlikely((PyObject_SetItem(__pyx_v_element_names, __pyx_v_attrname, __pyx_v_i) < 0))) __PYX_ERR(1, 582, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":581
 * 
 *                 element_names = collections.OrderedDict()
 *                 for i, attrname in enumerate(ti['attrnames']):             # <<<<<<<<<<<<<<
 *                     element_names[attrname] = i
 * 
*/
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":586
 *                 # If at least one element is text-encoded, we must
 *                 # encode the whole composite as text.
 *                 if has_text_elements:             # <<<<<<<<<<<<<<
 *                     elem_format = PG_FORMAT_TEXT
 *                 else:
*/
      if (__pyx_v_has_text_elements) {

        /* "asyncpg/protocol/codecs/base.pyx":587
 *                 # encode the whole composite as text.
 *                 if has_text_elements:
 *                     elem_format = PG_FORMAT_TEXT             # <<<<<<<<<<<<<<
 *                 else:
 *                     elem_format = PG_FORMAT_BINARY
*/
        __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT;

        /* "asyncpg/protocol/codecs/base.pyx":586
 *                 # If at least one element is text-encoded, we must
 *                 # encode the whole composite as text.
 *                 if has_text_elements:             # <<<<<<<<<<<<<<
 *                     elem_format = PG_FORMAT_TEXT
 *                 else:
*/
        goto __pyx_L19;
      }

      /* "asyncpg/protocol/codecs/base.pyx":589
 *                     elem_format = PG_FORMAT_TEXT
 *                 else:
 *                     elem_format = PG_FORMAT_BINARY             # <<<<<<<<<<<<<<
 * 
 *                 self._derived_type_codecs[oid, elem_format] = \
*/
      /*else*/ {
        __pyx_v_elem_format = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY;
      }
      __pyx_L19:;

      /* "asyncpg/protocol/codecs/base.pyx":593
 *                 self._derived_type_codecs[oid, elem_format] = \
 *                     Codec.new_composite_codec(
 *                         oid, name, schema, elem_format, comp_elem_codecs,             # <<<<<<<<<<<<<<
 *                         comp_type_attrs, element_names)
 * 
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 593, __pyx_L1_error)
      __pyx_t_4 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_4);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(1, 593, __pyx_L1_error)
      __pyx_t_12 = __pyx_v_schema;
      __Pyx_INCREF(__pyx_t_12);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_12))) __PYX_ERR(1, 593, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/base.pyx":592
 * 
 *                 self._derived_type_codecs[oid, elem_format] = \
 *                     Codec.new_composite_codec(             # <<<<<<<<<<<<<<
 *                         oid, name, schema, elem_format, comp_elem_codecs,
 *                         comp_type_attrs, element_names)
*/
      __pyx_t_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec(__pyx_t_5, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_12), __pyx_v_elem_format, __pyx_v_comp_elem_codecs, __pyx_v_comp_type_attrs, __pyx_v_element_names)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":591
 *                     elem_format = PG_FORMAT_BINARY
 * 
 *                 self._derived_type_codecs[oid, elem_format] = \             # <<<<<<<<<<<<<<
 *                     Codec.new_composite_codec(
 *                         oid, name, schema, elem_format, comp_elem_codecs,
*/
      if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 591, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_oid);
      __Pyx_GIVEREF(__pyx_v_oid);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12) != (0)) __PYX_ERR(1, 591, __pyx_L1_error);
      __pyx_t_12 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_4, __pyx_t_15) < 0))) __PYX_ERR(1, 591, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":561
 *                         oid, name, schema, elem_codec, elem_delim)
 * 
 *             elif ti['kind'] == b'c':             # <<<<<<<<<<<<<<
 *                 # Composite type
 * 
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":596
 *                         comp_type_attrs, element_names)
 * 
 *             elif ti['kind'] == b'd':             # <<<<<<<<<<<<<<
 *                 # Domain type
 * 
*/
    __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_t_15, __pyx_mstate_global->__pyx_n_b_d, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 596, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (__pyx_t_11) {

      /* "asyncpg/protocol/codecs/base.pyx":599
 *                 # Domain type
 * 
 *                 if not base_type:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for domain {oid}')
*/
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_base_type); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 599, __pyx_L1_error)
      __pyx_t_6 = (!__pyx_t_11);
      if (unlikely(__pyx_t_6)) {

        /* "asyncpg/protocol/codecs/base.pyx":600
 * 
 *                 if not base_type:
 *                     raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                         f'type record missing base type for domain {oid}')
 * 
*/
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":601
 *                 if not base_type:
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for domain {oid}')             # <<<<<<<<<<<<<<
 * 
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)
*/
        __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 601, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 601, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13};
          __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 600, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
        }
        __Pyx_Raise(__pyx_t_15, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __PYX_ERR(1, 600, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":599
 *                 # Domain type
 * 
 *                 if not base_type:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for domain {oid}')
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":603
 *                         f'type record missing base type for domain {oid}')
 * 
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_base_type); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 603, __pyx_L1_error)
      __pyx_t_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_15));
      __pyx_t_15 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":604
 * 
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         base_type, ti['basetype_name'], schema)
*/
      __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/base.pyx":605
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         base_type, ti['basetype_name'], schema)
 * 
*/
        __pyx_t_7 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_7);

        /* "asyncpg/protocol/codecs/base.pyx":606
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
 *                         base_type, ti['basetype_name'], schema)             # <<<<<<<<<<<<<<
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = elem_codec
*/
        __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_basetype_name); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_base_type, __pyx_t_13, __pyx_v_schema};
          __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 605, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_15);
        }

        /* "asyncpg/protocol/codecs/base.pyx":605
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         base_type, ti['basetype_name'], schema)
 * 
*/
        if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 605, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_15));
        __pyx_t_15 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":604
 * 
 *                 elem_codec = self.get_codec(base_type, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         base_type, ti['basetype_name'], schema)
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":608
 *                         base_type, ti['basetype_name'], schema)
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = elem_codec             # <<<<<<<<<<<<<<
 * 
 *             elif ti['kind'] == b'r':
*/
      if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 608, __pyx_L1_error)
      }
      __pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_v_oid);
      __Pyx_GIVEREF(__pyx_v_oid);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 608, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_15);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15) != (0)) __PYX_ERR(1, 608, __pyx_L1_error);
      __pyx_t_15 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_13, ((PyObject *)__pyx_v_elem_codec)) < 0))) __PYX_ERR(1, 608, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":596
 *                         comp_type_attrs, element_names)
 * 
 *             elif ti['kind'] == b'd':             # <<<<<<<<<<<<<<
 *                 # Domain type
 * 
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":610
 *                 self._derived_type_codecs[oid, elem_codec.format] = elem_codec
 * 
 *             elif ti['kind'] == b'r':             # <<<<<<<<<<<<<<
 *                 # Range type
 * 
*/
    __pyx_t_13 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_13, __pyx_mstate_global->__pyx_n_b_r, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":613
 *                 # Range type
 * 
 *                 if not range_subtype_oid:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for range {oid}')
*/
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 613, __pyx_L1_error)
      __pyx_t_11 = (!__pyx_t_6);
      if (unlikely(__pyx_t_11)) {

        /* "asyncpg/protocol/codecs/base.pyx":614
 * 
 *                 if not range_subtype_oid:
 *                     raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                         f'type record missing base type for range {oid}')
 * 
*/
        __pyx_t_15 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":615
 *                 if not range_subtype_oid:
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for range {oid}')             # <<<<<<<<<<<<<<
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
*/
        __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_2, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_15);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_12};
          __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(1, 614, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":613
 *                 # Range type
 * 
 *                 if not range_subtype_oid:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for range {oid}')
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":617
 *                         f'type record missing base type for range {oid}')
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 617, __pyx_L1_error)
      __pyx_t_13 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13));
      __pyx_t_13 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":618
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
*/
      __pyx_t_11 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
      if (__pyx_t_11) {

        /* "asyncpg/protocol/codecs/base.pyx":619
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
*/
        __pyx_t_4 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_4);

        /* "asyncpg/protocol/codecs/base.pyx":620
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)             # <<<<<<<<<<<<<<
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
*/
        __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 620, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_range_subtype_oid, __pyx_t_12, __pyx_v_schema};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
        }

        /* "asyncpg/protocol/codecs/base.pyx":619
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
*/
        if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 619, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13));
        __pyx_t_13 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":618
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":623
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
 *                     Codec.new_range_codec(oid, name, schema, elem_codec)             # <<<<<<<<<<<<<<
 * 
 *             elif ti['kind'] == b'm':
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 623, __pyx_L1_error)
      __pyx_t_13 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_13);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_13))) __PYX_ERR(1, 623, __pyx_L1_error)
      __pyx_t_12 = __pyx_v_schema;
      __Pyx_INCREF(__pyx_t_12);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_12))||((__pyx_t_12) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_12))) __PYX_ERR(1, 623, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec(__pyx_t_5, ((PyObject*)__pyx_t_13), ((PyObject*)__pyx_t_12), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":622
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \             # <<<<<<<<<<<<<<
 *                     Codec.new_range_codec(oid, name, schema, elem_codec)
 * 
*/
      if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 622, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_v_oid);
      __Pyx_GIVEREF(__pyx_v_oid);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 622, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_12);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_12) != (0)) __PYX_ERR(1, 622, __pyx_L1_error);
      __pyx_t_12 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_13, __pyx_t_4) < 0))) __PYX_ERR(1, 622, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":610
 *                 self._derived_type_codecs[oid, elem_codec.format] = elem_codec
 * 
 *             elif ti['kind'] == b'r':             # <<<<<<<<<<<<<<
 *                 # Range type
 * 
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":625
 *                     Codec.new_range_codec(oid, name, schema, elem_codec)
 * 
 *             elif ti['kind'] == b'm':             # <<<<<<<<<<<<<<
 *                 # Multirange type
 * 
*/
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_b_m, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 625, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_11) {

      /* "asyncpg/protocol/codecs/base.pyx":628
 *                 # Multirange type
 * 
 *                 if not range_subtype_oid:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for multirange {oid}')
*/
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(1, 628, __pyx_L1_error)
      __pyx_t_6 = (!__pyx_t_11);
      if (unlikely(__pyx_t_6)) {

        /* "asyncpg/protocol/codecs/base.pyx":629
 * 
 *                 if not range_subtype_oid:
 *                     raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                         f'type record missing base type for multirange {oid}')
 * 
*/
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":630
 *                 if not range_subtype_oid:
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for multirange {oid}')             # <<<<<<<<<<<<<<
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
*/
        __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_oid, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_type_record_missing_base_type_fo_3, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 630, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_8 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_15))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
          __pyx_t_8 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(1, 629, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/base.pyx":628
 *                 # Multirange type
 * 
 *                 if not range_subtype_oid:             # <<<<<<<<<<<<<<
 *                     raise exceptions.InternalClientError(
 *                         f'type record missing base type for multirange {oid}')
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":632
 *                         f'type record missing base type for multirange {oid}')
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_range_subtype_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 632, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_t_5, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":633
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
*/
      __pyx_t_6 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/base.pyx":634
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
*/
        __pyx_t_15 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_15);

        /* "asyncpg/protocol/codecs/base.pyx":635
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)             # <<<<<<<<<<<<<<
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
*/
        __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_range_subtype_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 635, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = 0;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_v_range_subtype_oid, __pyx_t_7, __pyx_v_schema};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }

        /* "asyncpg/protocol/codecs/base.pyx":634
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:
 *                     elem_codec = self.declare_fallback_codec(             # <<<<<<<<<<<<<<
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
*/
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 634, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":633
 * 
 *                 elem_codec = self.get_codec(range_subtype_oid, PG_FORMAT_ANY)
 *                 if elem_codec is None:             # <<<<<<<<<<<<<<
 *                     elem_codec = self.declare_fallback_codec(
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":638
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \
 *                     Codec.new_multirange_codec(oid, name, schema, elem_codec)             # <<<<<<<<<<<<<<
 * 
 *             elif ti['kind'] == b'e':
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
      __pyx_t_4 = __pyx_v_name;
      __Pyx_INCREF(__pyx_t_4);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(1, 638, __pyx_L1_error)
      __pyx_t_7 = __pyx_v_schema;
      __Pyx_INCREF(__pyx_t_7);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(1, 638, __pyx_L1_error)
      __pyx_t_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec(__pyx_t_5, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_7), __pyx_v_elem_codec)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 638, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":637
 *                         range_subtype_oid, ti['range_subtype_name'], schema)
 * 
 *                 self._derived_type_codecs[oid, elem_codec.format] = \             # <<<<<<<<<<<<<<
 *                     Codec.new_multirange_codec(oid, name, schema, elem_codec)
 * 
*/
      if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 637, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_elem_codec->format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 637, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_oid);
      __Pyx_GIVEREF(__pyx_v_oid);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_oid) != (0)) __PYX_ERR(1, 637, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 637, __pyx_L1_error);
      __pyx_t_7 = 0;
      if (unlikely((PyDict_SetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_4, __pyx_t_15) < 0))) __PYX_ERR(1, 637, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":625
 *                     Codec.new_range_codec(oid, name, schema, elem_codec)
 * 
 *             elif ti['kind'] == b'm':             # <<<<<<<<<<<<<<
 *                 # Multirange type
 * 
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":640
 *                     Codec.new_multirange_codec(oid, name, schema, elem_codec)
 * 
 *             elif ti['kind'] == b'e':             # <<<<<<<<<<<<<<
 *                 # Enum types are essentially text
 *                 self._set_builtin_type_codec(oid, name, schema, 'scalar',
*/
    __pyx_t_15 = __Pyx_PyObject_Dict_GetItem(__pyx_v_ti, __pyx_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_t_15, __pyx_mstate_global->__pyx_n_b_e, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/base.pyx":642
 *             elif ti['kind'] == b'e':
 *                 # Enum types are essentially text
 *                 self._set_builtin_type_codec(oid, name, schema, 'scalar',             # <<<<<<<<<<<<<<
 *                                              TEXTOID, PG_FORMAT_ANY)
 *             else:
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);

      /* "asyncpg/protocol/codecs/base.pyx":643
 *                 # Enum types are essentially text
 *                 self._set_builtin_type_codec(oid, name, schema, 'scalar',
 *                                              TEXTOID, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.declare_fallback_codec(oid, name, schema)
*/
      __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[7] = {__pyx_t_4, __pyx_v_oid, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_scalar, __pyx_mstate_global->__pyx_int_25, __pyx_t_7};
        __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_8, (7-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":640
 *                     Codec.new_multirange_codec(oid, name, schema, elem_codec)
 * 
 *             elif ti['kind'] == b'e':             # <<<<<<<<<<<<<<
 *                 # Enum types are essentially text
 *                 self._set_builtin_type_codec(oid, name, schema, 'scalar',
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":645
 *                                              TEXTOID, PG_FORMAT_ANY)
 *             else:
 *                 self.declare_fallback_codec(oid, name, schema)             # <<<<<<<<<<<<<<
 * 
 *     def add_python_codec(self, typeoid, typename, typeschema, typekind,
*/
    /*else*/ {
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_oid, __pyx_v_name, __pyx_v_schema};
        __pyx_t_15 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 645, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
      }
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __pyx_L7:;

    /* "asyncpg/protocol/codecs/base.pyx":526
 *             Py_UCS4 elem_delim
 * 
 *         for ti in types:             # <<<<<<<<<<<<<<
 *             oid = ti['oid']
 * 
*/
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":517
 *         self._custom_type_codecs = {}
 * 
 *     def add_types(self, types):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec elem_codec
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_comp_elem_codecs);
  __Pyx_XDECREF(__pyx_v_ti);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_schema);
  __Pyx_XDECREF(__pyx_v_array_element_oid);
  __Pyx_XDECREF(__pyx_v_range_subtype_oid);
  __Pyx_XDECREF(__pyx_v_comp_type_attrs);
  __Pyx_XDECREF(__pyx_v_base_type);
  __Pyx_XDECREF(__pyx_v_typoid);
  __Pyx_XDECREF(__pyx_v_element_names);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_attrname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":647
 *                 self.declare_fallback_codec(oid, name, schema)
 * 
 *     def add_python_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                          typeinfos, encoder, decoder, format, xformat):
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec = {"add_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  PyObject *__pyx_v_typekind = 0;
  PyObject *__pyx_v_typeinfos = 0;
  PyObject *__pyx_v_encoder = 0;
  PyObject *__pyx_v_decoder = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_xformat = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_python_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_typeinfos,&__pyx_mstate_global->__pyx_n_u_encoder,&__pyx_mstate_global->__pyx_n_u_decoder,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_xformat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 647, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_python_codec", 0) < (0)) __PYX_ERR(1, 647, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, i); __PYX_ERR(1, 647, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 9)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(1, 647, __pyx_L3_error)
      values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(1, 647, __pyx_L3_error)
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
    __pyx_v_typekind = values[3];
    __pyx_v_typeinfos = values[4];
    __pyx_v_encoder = values[5];
    __pyx_v_decoder = values[6];
    __pyx_v_format = values[7];
    __pyx_v_xformat = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_python_codec", 1, 9, 9, __pyx_nargs); __PYX_ERR(1, 647, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_typeinfos, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format, __pyx_v_xformat);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_4add_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_typeinfos, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format, PyObject *__pyx_v_xformat) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_core_codec = 0;
  __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_c_encoder;
  __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_c_decoder;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_base_codec = 0;
  uint32_t __pyx_v_oid;
  int __pyx_v_codec_set;
  PyObject *__pyx_v_formats = NULL;
  PyObject *__pyx_v_fmt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  uint32_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_9;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_t_10;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec __pyx_t_11;
  __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_t_12;
  __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_python_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":650
 *                          typeinfos, encoder, decoder, format, xformat):
 *         cdef:
 *             Codec core_codec = None             # <<<<<<<<<<<<<<
 *             encode_func c_encoder = NULL
 *             decode_func c_decoder = NULL
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_core_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None);

  /* "asyncpg/protocol/codecs/base.pyx":651
 *         cdef:
 *             Codec core_codec = None
 *             encode_func c_encoder = NULL             # <<<<<<<<<<<<<<
 *             decode_func c_decoder = NULL
 *             Codec base_codec = None
*/
  __pyx_v_c_encoder = NULL;

  /* "asyncpg/protocol/codecs/base.pyx":652
 *             Codec core_codec = None
 *             encode_func c_encoder = NULL
 *             decode_func c_decoder = NULL             # <<<<<<<<<<<<<<
 *             Codec base_codec = None
 *             uint32_t oid = pylong_as_oid(typeoid)
*/
  __pyx_v_c_decoder = NULL;

  /* "asyncpg/protocol/codecs/base.pyx":653
 *             encode_func c_encoder = NULL
 *             decode_func c_decoder = NULL
 *             Codec base_codec = None             # <<<<<<<<<<<<<<
 *             uint32_t oid = pylong_as_oid(typeoid)
 *             bint codec_set = False
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None);

  /* "asyncpg/protocol/codecs/base.pyx":654
 *             decode_func c_decoder = NULL
 *             Codec base_codec = None
 *             uint32_t oid = pylong_as_oid(typeoid)             # <<<<<<<<<<<<<<
 *             bint codec_set = False
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_typeoid); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(1, 654, __pyx_L1_error)
  __pyx_v_oid = __pyx_t_1;

  /* "asyncpg/protocol/codecs/base.pyx":655
 *             Codec base_codec = None
 *             uint32_t oid = pylong_as_oid(typeoid)
 *             bint codec_set = False             # <<<<<<<<<<<<<<
 * 
 *         # Clear all previous overrides (this also clears type cache).
*/
  __pyx_v_codec_set = 0;

  /* "asyncpg/protocol/codecs/base.pyx":658
 * 
 *         # Clear all previous overrides (this also clears type cache).
 *         self.remove_python_codec(typeoid, typename, typeschema)             # <<<<<<<<<<<<<<
 * 
 *         if typeinfos:
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":660
 *         self.remove_python_codec(typeoid, typename, typeschema)
 * 
 *         if typeinfos:             # <<<<<<<<<<<<<<
 *             self.add_types(typeinfos)
 * 
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_typeinfos); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 660, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "asyncpg/protocol/codecs/base.pyx":661
 * 
 *         if typeinfos:
 *             self.add_types(typeinfos)             # <<<<<<<<<<<<<<
 * 
 *         if format == PG_FORMAT_ANY:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_typeinfos};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_types, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":660
 *         self.remove_python_codec(typeoid, typename, typeschema)
 * 
 *         if typeinfos:             # <<<<<<<<<<<<<<
 *             self.add_types(typeinfos)
 * 
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":663
 *             self.add_types(typeinfos)
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY)
 *         else:
*/
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "asyncpg/protocol/codecs/base.pyx":664
 * 
 *         if format == PG_FORMAT_ANY:
 *             formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 *         else:
 *             formats = (format,)
*/
    __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 664, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 664, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_v_formats = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":663
 *             self.add_types(typeinfos)
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY)
 *         else:
*/
    goto __pyx_L4;
  }

  /* "asyncpg/protocol/codecs/base.pyx":666
 *             formats = (PG_FORMAT_TEXT, PG_FORMAT_BINARY)
 *         else:
 *             formats = (format,)             # <<<<<<<<<<<<<<
 * 
 *         for fmt in formats:
*/
  /*else*/ {
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_format) != (0)) __PYX_ERR(1, 666, __pyx_L1_error);
    __pyx_v_formats = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L4:;

  /* "asyncpg/protocol/codecs/base.pyx":668
 *             formats = (format,)
 * 
 *         for fmt in formats:             # <<<<<<<<<<<<<<
 *             if xformat == PG_XFORMAT_TUPLE:
 *                 if typekind == "scalar":
*/
  if (likely(PyList_CheckExact(__pyx_v_formats)) || PyTuple_CheckExact(__pyx_v_formats)) {
    __pyx_t_6 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 668, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 668, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_7;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 668, __pyx_L1_error)
          #endif
          if (__pyx_t_7 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7));
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_7);
        #endif
        ++__pyx_t_7;
      }
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 668, __pyx_L1_error)
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 668, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_fmt, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":669
 * 
 *         for fmt in formats:
 *             if xformat == PG_XFORMAT_TUPLE:             # <<<<<<<<<<<<<<
 *                 if typekind == "scalar":
 *                     core_codec = get_core_codec(oid, fmt, xformat)
*/
    __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_xformat, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 669, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {

      /* "asyncpg/protocol/codecs/base.pyx":670
 *         for fmt in formats:
 *             if xformat == PG_XFORMAT_TUPLE:
 *                 if typekind == "scalar":             # <<<<<<<<<<<<<<
 *                     core_codec = get_core_codec(oid, fmt, xformat)
 *                     if core_codec is None:
*/
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_mstate_global->__pyx_n_u_scalar, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 670, __pyx_L1_error)
      if (__pyx_t_5) {

        /* "asyncpg/protocol/codecs/base.pyx":671
 *             if xformat == PG_XFORMAT_TUPLE:
 *                 if typekind == "scalar":
 *                     core_codec = get_core_codec(oid, fmt, xformat)             # <<<<<<<<<<<<<<
 *                     if core_codec is None:
 *                         continue
*/
        __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 671, __pyx_L1_error)
        __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 671, __pyx_L1_error)
        __pyx_t_11.__pyx_n = 1;
        __pyx_t_11.xformat = __pyx_t_10;
        __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_t_9, &__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_core_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":672
 *                 if typekind == "scalar":
 *                     core_codec = get_core_codec(oid, fmt, xformat)
 *                     if core_codec is None:             # <<<<<<<<<<<<<<
 *                         continue
 *                     c_encoder = core_codec.c_encoder
*/
        __pyx_t_5 = (((PyObject *)__pyx_v_core_codec) == Py_None);
        if (__pyx_t_5) {

          /* "asyncpg/protocol/codecs/base.pyx":673
 *                     core_codec = get_core_codec(oid, fmt, xformat)
 *                     if core_codec is None:
 *                         continue             # <<<<<<<<<<<<<<
 *                     c_encoder = core_codec.c_encoder
 *                     c_decoder = core_codec.c_decoder
*/
          goto __pyx_L5_continue;

          /* "asyncpg/protocol/codecs/base.pyx":672
 *                 if typekind == "scalar":
 *                     core_codec = get_core_codec(oid, fmt, xformat)
 *                     if core_codec is None:             # <<<<<<<<<<<<<<
 *                         continue
 *                     c_encoder = core_codec.c_encoder
*/
        }

        /* "asyncpg/protocol/codecs/base.pyx":674
 *                     if core_codec is None:
 *                         continue
 *                     c_encoder = core_codec.c_encoder             # <<<<<<<<<<<<<<
 *                     c_decoder = core_codec.c_decoder
 *                 elif typekind == "composite":
*/
        __pyx_t_12 = __pyx_v_core_codec->c_encoder;
        __pyx_v_c_encoder = __pyx_t_12;

        /* "asyncpg/protocol/codecs/base.pyx":675
 *                         continue
 *                     c_encoder = core_codec.c_encoder
 *                     c_decoder = core_codec.c_decoder             # <<<<<<<<<<<<<<
 *                 elif typekind == "composite":
 *                     base_codec = self.get_codec(oid, fmt)
*/
        __pyx_t_13 = __pyx_v_core_codec->c_decoder;
        __pyx_v_c_decoder = __pyx_t_13;

        /* "asyncpg/protocol/codecs/base.pyx":670
 *         for fmt in formats:
 *             if xformat == PG_XFORMAT_TUPLE:
 *                 if typekind == "scalar":             # <<<<<<<<<<<<<<
 *                     core_codec = get_core_codec(oid, fmt, xformat)
 *                     if core_codec is None:
*/
        goto __pyx_L8;
      }

      /* "asyncpg/protocol/codecs/base.pyx":676
 *                     c_encoder = core_codec.c_encoder
 *                     c_decoder = core_codec.c_decoder
 *                 elif typekind == "composite":             # <<<<<<<<<<<<<<
 *                     base_codec = self.get_codec(oid, fmt)
 *                     if base_codec is None:
*/
      __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_typekind, __pyx_mstate_global->__pyx_n_u_composite, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 676, __pyx_L1_error)
      if (__pyx_t_5) {

        /* "asyncpg/protocol/codecs/base.pyx":677
 *                     c_decoder = core_codec.c_decoder
 *                 elif typekind == "composite":
 *                     base_codec = self.get_codec(oid, fmt)             # <<<<<<<<<<<<<<
 *                     if base_codec is None:
 *                         continue
*/
        __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 677, __pyx_L1_error)
        __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_t_9, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_base_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":678
 *                 elif typekind == "composite":
 *                     base_codec = self.get_codec(oid, fmt)
 *                     if base_codec is None:             # <<<<<<<<<<<<<<
 *                         continue
 * 
*/
        __pyx_t_5 = (((PyObject *)__pyx_v_base_codec) == Py_None);
        if (__pyx_t_5) {

          /* "asyncpg/protocol/codecs/base.pyx":679
 *                     base_codec = self.get_codec(oid, fmt)
 *                     if base_codec is None:
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *             self._custom_type_codecs[typeoid, fmt] = \
*/
          goto __pyx_L5_continue;

          /* "asyncpg/protocol/codecs/base.pyx":678
 *                 elif typekind == "composite":
 *                     base_codec = self.get_codec(oid, fmt)
 *                     if base_codec is None:             # <<<<<<<<<<<<<<
 *                         continue
 * 
*/
        }

        /* "asyncpg/protocol/codecs/base.pyx":676
 *                     c_encoder = core_codec.c_encoder
 *                     c_decoder = core_codec.c_decoder
 *                 elif typekind == "composite":             # <<<<<<<<<<<<<<
 *                     base_codec = self.get_codec(oid, fmt)
 *                     if base_codec is None:
*/
      }
      __pyx_L8:;

      /* "asyncpg/protocol/codecs/base.pyx":669
 * 
 *         for fmt in formats:
 *             if xformat == PG_XFORMAT_TUPLE:             # <<<<<<<<<<<<<<
 *                 if typekind == "scalar":
 *                     core_codec = get_core_codec(oid, fmt, xformat)
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":682
 * 
 *             self._custom_type_codecs[typeoid, fmt] = \
 *                 Codec.new_python_codec(oid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                        encoder, decoder, c_encoder, c_decoder,
 *                                        base_codec, fmt, xformat)
*/
    __pyx_t_3 = __pyx_v_typename;
    __Pyx_INCREF(__pyx_t_3);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(1, 682, __pyx_L1_error)
    __pyx_t_2 = __pyx_v_typeschema;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 682, __pyx_L1_error)
    __pyx_t_14 = __pyx_v_typekind;
    __Pyx_INCREF(__pyx_t_14);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_14))||((__pyx_t_14) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_14))) __PYX_ERR(1, 682, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":684
 *                 Codec.new_python_codec(oid, typename, typeschema, typekind,
 *                                        encoder, decoder, c_encoder, c_decoder,
 *                                        base_codec, fmt, xformat)             # <<<<<<<<<<<<<<
 *             codec_set = True
 * 
*/
    __pyx_t_9 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 684, __pyx_L1_error)
    __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(__pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 684, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":682
 * 
 *             self._custom_type_codecs[typeoid, fmt] = \
 *                 Codec.new_python_codec(oid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                        encoder, decoder, c_encoder, c_decoder,
 *                                        base_codec, fmt, xformat)
*/
    __pyx_t_15 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec(__pyx_v_oid, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_14), __pyx_v_encoder, __pyx_v_decoder, __pyx_v_c_encoder, __pyx_v_c_decoder, __pyx_v_base_codec, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":681
 *                         continue
 * 
 *             self._custom_type_codecs[typeoid, fmt] = \             # <<<<<<<<<<<<<<
 *                 Codec.new_python_codec(oid, typename, typeschema, typekind,
 *                                        encoder, decoder, c_encoder, c_decoder,
*/
    if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 681, __pyx_L1_error)
    }
    __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_INCREF(__pyx_v_typeoid);
    __Pyx_GIVEREF(__pyx_v_typeoid);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_typeoid) != (0)) __PYX_ERR(1, 681, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_fmt);
    __Pyx_GIVEREF(__pyx_v_fmt);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_fmt) != (0)) __PYX_ERR(1, 681, __pyx_L1_error);
    if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_14, __pyx_t_15) < 0))) __PYX_ERR(1, 681, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":685
 *                                        encoder, decoder, c_encoder, c_decoder,
 *                                        base_codec, fmt, xformat)
 *             codec_set = True             # <<<<<<<<<<<<<<
 * 
 *         if not codec_set:
*/
    __pyx_v_codec_set = 1;

    /* "asyncpg/protocol/codecs/base.pyx":668
 *             formats = (format,)
 * 
 *         for fmt in formats:             # <<<<<<<<<<<<<<
 *             if xformat == PG_XFORMAT_TUPLE:
 *                 if typekind == "scalar":
*/
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":687
 *             codec_set = True
 * 
 *         if not codec_set:             # <<<<<<<<<<<<<<
 *             raise exceptions.InterfaceError(
 *                 "{} type does not support the 'tuple' exchange format".format(
*/
  __pyx_t_5 = (!__pyx_v_codec_set);
  if (unlikely(__pyx_t_5)) {

    /* "asyncpg/protocol/codecs/base.pyx":688
 * 
 *         if not codec_set:
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 "{} type does not support the 'tuple' exchange format".format(
 *                     typename))
*/
    __pyx_t_15 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":689
 *         if not codec_set:
 *             raise exceptions.InterfaceError(
 *                 "{} type does not support the 'tuple' exchange format".format(             # <<<<<<<<<<<<<<
 *                     typename))
 * 
*/
    __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_type_does_not_support_the_tuple;
    __Pyx_INCREF(__pyx_t_3);

    /* "asyncpg/protocol/codecs/base.pyx":690
 *             raise exceptions.InterfaceError(
 *                 "{} type does not support the 'tuple' exchange format".format(
 *                     typename))             # <<<<<<<<<<<<<<
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):
*/
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_typename};
      __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
    }
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_15);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_15);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_14};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(1, 688, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":687
 *             codec_set = True
 * 
 *         if not codec_set:             # <<<<<<<<<<<<<<
 *             raise exceptions.InterfaceError(
 *                 "{} type does not support the 'tuple' exchange format".format(
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":647
 *                 self.declare_fallback_codec(oid, name, schema)
 * 
 *     def add_python_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                          typeinfos, encoder, decoder, format, xformat):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.add_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_core_codec);
  __Pyx_XDECREF((PyObject *)__pyx_v_base_codec);
  __Pyx_XDECREF(__pyx_v_formats);
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":692
 *                     typename))
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec = {"remove_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  CYTHON_UNUSED PyObject *__pyx_v_typename = 0;
  CYTHON_UNUSED PyObject *__pyx_v_typeschema = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("remove_python_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 692, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 692, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove_python_codec", 0) < (0)) __PYX_ERR(1, 692, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, i); __PYX_ERR(1, 692, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 692, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 692, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 692, __pyx_L3_error)
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("remove_python_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 692, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.remove_python_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_6remove_python_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, CYTHON_UNUSED PyObject *__pyx_v_typename, CYTHON_UNUSED PyObject *__pyx_v_typeschema) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_fmt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_5;
  int __pyx_t_6;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove_python_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":693
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):             # <<<<<<<<<<<<<<
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
 *         self.clear_type_cache()
*/
  __pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 693, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 693, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_4 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 693, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_fmt = __pyx_t_5;

    /* "asyncpg/protocol/codecs/base.pyx":694
 *     def remove_python_codec(self, typeoid, typename, typeschema):
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):
 *             self._custom_type_codecs.pop((typeoid, fmt), None)             # <<<<<<<<<<<<<<
 *         self.clear_type_cache()
 * 
*/
    if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
      __PYX_ERR(1, 694, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_fmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_typeoid);
    __Pyx_GIVEREF(__pyx_v_typeoid);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_typeoid) != (0)) __PYX_ERR(1, 694, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 694, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyDict_Pop_ignore(__pyx_v_self->_custom_type_codecs, __pyx_t_1, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":693
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):             # <<<<<<<<<<<<<<
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
 *         self.clear_type_cache()
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":695
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
 *         self.clear_type_cache()             # <<<<<<<<<<<<<<
 * 
 *     def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":692
 *                     typename))
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
*/

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

/* "asyncpg/protocol/codecs/base.pyx":697
 *         self.clear_type_cache()
 * 
 *     def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                 alias_to, format=PG_FORMAT_ANY):
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec = {"_set_builtin_type_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  PyObject *__pyx_v_typekind = 0;
  PyObject *__pyx_v_alias_to = 0;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_builtin_type_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 697, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_set_builtin_type_codec", 0) < (0)) __PYX_ERR(1, 697, __pyx_L3_error)
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__4);
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, i); __PYX_ERR(1, 697, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 697, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 697, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 697, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 697, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 697, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__4);
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
    __pyx_v_typekind = values[3];
    __pyx_v_alias_to = values[4];
    __pyx_v_format = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_builtin_type_codec", 0, 5, 6, __pyx_nargs); __PYX_ERR(1, 697, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig._set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_8_set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_target_codec = 0;
  CYTHON_UNUSED uint32_t __pyx_v_oid;
  uint32_t __pyx_v_alias_oid;
  int __pyx_v_codec_set;
  PyObject *__pyx_v_formats = NULL;
  PyObject *__pyx_v_codec_str = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  uint32_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13[8];
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_builtin_type_codec", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "asyncpg/protocol/codecs/base.pyx":702
 *             Codec codec
 *             Codec target_codec
 *             uint32_t oid = pylong_as_oid(typeoid)             # <<<<<<<<<<<<<<
 *             uint32_t alias_oid = 0
 *             bint codec_set = False
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_typeoid); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(1, 702, __pyx_L1_error)
  __pyx_v_oid = __pyx_t_1;

  /* "asyncpg/protocol/codecs/base.pyx":703
 *             Codec target_codec
 *             uint32_t oid = pylong_as_oid(typeoid)
 *             uint32_t alias_oid = 0             # <<<<<<<<<<<<<<
 *             bint codec_set = False
 * 
*/
  __pyx_v_alias_oid = 0;

  /* "asyncpg/protocol/codecs/base.pyx":704
 *             uint32_t oid = pylong_as_oid(typeoid)
 *             uint32_t alias_oid = 0
 *             bint codec_set = False             # <<<<<<<<<<<<<<
 * 
 *         if format == PG_FORMAT_ANY:
*/
  __pyx_v_codec_set = 0;

  /* "asyncpg/protocol/codecs/base.pyx":706
 *             bint codec_set = False
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT)
 *         else:
*/
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "asyncpg/protocol/codecs/base.pyx":707
 * 
 *         if format == PG_FORMAT_ANY:
 *             formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 *         else:
 *             formats = (format,)
*/
    __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 707, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 707, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_v_formats = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":706
 *             bint codec_set = False
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/codecs/base.pyx":709
 *             formats = (PG_FORMAT_BINARY, PG_FORMAT_TEXT)
 *         else:
 *             formats = (format,)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(alias_to, int):
*/
  /*else*/ {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_format) != (0)) __PYX_ERR(1, 709, __pyx_L1_error);
    __pyx_v_formats = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/codecs/base.pyx":711
 *             formats = (format,)
 * 
 *         if isinstance(alias_to, int):             # <<<<<<<<<<<<<<
 *             alias_oid = pylong_as_oid(alias_to)
 *         else:
*/
  __pyx_t_4 = PyLong_Check(__pyx_v_alias_to); 
  if (__pyx_t_4) {

    /* "asyncpg/protocol/codecs/base.pyx":712
 * 
 *         if isinstance(alias_to, int):
 *             alias_oid = pylong_as_oid(alias_to)             # <<<<<<<<<<<<<<
 *         else:
 *             alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0)
*/
    __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_pylong_as_oid(__pyx_v_alias_to); if (unlikely(__pyx_t_1 == ((uint32_t)0xFFFFFFFFL) && PyErr_Occurred())) __PYX_ERR(1, 712, __pyx_L1_error)
    __pyx_v_alias_oid = __pyx_t_1;

    /* "asyncpg/protocol/codecs/base.pyx":711
 *             formats = (format,)
 * 
 *         if isinstance(alias_to, int):             # <<<<<<<<<<<<<<
 *             alias_oid = pylong_as_oid(alias_to)
 *         else:
*/
    goto __pyx_L4;
  }

  /* "asyncpg/protocol/codecs/base.pyx":714
 *             alias_oid = pylong_as_oid(alias_to)
 *         else:
 *             alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0)             # <<<<<<<<<<<<<<
 * 
 *         for format in formats:
*/
  /*else*/ {
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_alias_to, __pyx_mstate_global->__pyx_int_0};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 714, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_1 = __Pyx_PyLong_As_uint32_t(__pyx_t_5); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 714, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_alias_oid = __pyx_t_1;
  }
  __pyx_L4:;

  /* "asyncpg/protocol/codecs/base.pyx":716
 *             alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0)
 * 
 *         for format in formats:             # <<<<<<<<<<<<<<
 *             if alias_oid != 0:
 *                 target_codec = self.get_codec(alias_oid, format)
*/
  if (likely(PyList_CheckExact(__pyx_v_formats)) || PyTuple_CheckExact(__pyx_v_formats)) {
    __pyx_t_5 = __pyx_v_formats; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_formats); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 716, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 716, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_8;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 716, __pyx_L1_error)
          #endif
          if (__pyx_t_8 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_8);
        #endif
        ++__pyx_t_8;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 716, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_9(__pyx_t_5);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 716, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":717
 * 
 *         for format in formats:
 *             if alias_oid != 0:             # <<<<<<<<<<<<<<
 *                 target_codec = self.get_codec(alias_oid, format)
 *             else:
*/
    __pyx_t_4 = (__pyx_v_alias_oid != 0);
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/base.pyx":718
 *         for format in formats:
 *             if alias_oid != 0:
 *                 target_codec = self.get_codec(alias_oid, format)             # <<<<<<<<<<<<<<
 *             else:
 *                 target_codec = get_extra_codec(alias_to, format)
*/
      __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 718, __pyx_L1_error)
      __pyx_t_6 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_alias_oid, __pyx_t_10, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":717
 * 
 *         for format in formats:
 *             if alias_oid != 0:             # <<<<<<<<<<<<<<
 *                 target_codec = self.get_codec(alias_oid, format)
 *             else:
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/base.pyx":720
 *                 target_codec = self.get_codec(alias_oid, format)
 *             else:
 *                 target_codec = get_extra_codec(alias_to, format)             # <<<<<<<<<<<<<<
 * 
 *             if target_codec is None:
*/
    /*else*/ {
      __pyx_t_6 = __pyx_v_alias_to;
      __Pyx_INCREF(__pyx_t_6);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(1, 720, __pyx_L1_error)
      __pyx_t_10 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 720, __pyx_L1_error)
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(((PyObject*)__pyx_t_6), __pyx_t_10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_target_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __pyx_L7:;

    /* "asyncpg/protocol/codecs/base.pyx":722
 *                 target_codec = get_extra_codec(alias_to, format)
 * 
 *             if target_codec is None:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    __pyx_t_4 = (((PyObject *)__pyx_v_target_codec) == Py_None);
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/base.pyx":723
 * 
 *             if target_codec is None:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             codec = target_codec.copy()
*/
      goto __pyx_L5_continue;

      /* "asyncpg/protocol/codecs/base.pyx":722
 *                 target_codec = get_extra_codec(alias_to, format)
 * 
 *             if target_codec is None:             # <<<<<<<<<<<<<<
 *                 continue
 * 
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":725
 *                 continue
 * 
 *             codec = target_codec.copy()             # <<<<<<<<<<<<<<
 *             codec.oid = typeoid
 *             codec.name = typename
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy(__pyx_v_target_codec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":726
 * 
 *             codec = target_codec.copy()
 *             codec.oid = typeoid             # <<<<<<<<<<<<<<
 *             codec.name = typename
 *             codec.schema = typeschema
*/
    __pyx_t_1 = __Pyx_PyLong_As_uint32_t(__pyx_v_typeoid); if (unlikely((__pyx_t_1 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 726, __pyx_L1_error)
    __pyx_v_codec->oid = __pyx_t_1;

    /* "asyncpg/protocol/codecs/base.pyx":727
 *             codec = target_codec.copy()
 *             codec.oid = typeoid
 *             codec.name = typename             # <<<<<<<<<<<<<<
 *             codec.schema = typeschema
 *             codec.kind = typekind
*/
    __pyx_t_2 = __pyx_v_typename;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 727, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_codec->name);
    __Pyx_DECREF(__pyx_v_codec->name);
    __pyx_v_codec->name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":728
 *             codec.oid = typeoid
 *             codec.name = typename
 *             codec.schema = typeschema             # <<<<<<<<<<<<<<
 *             codec.kind = typekind
 * 
*/
    __pyx_t_2 = __pyx_v_typeschema;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 728, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_codec->schema);
    __Pyx_DECREF(__pyx_v_codec->schema);
    __pyx_v_codec->schema = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":729
 *             codec.name = typename
 *             codec.schema = typeschema
 *             codec.kind = typekind             # <<<<<<<<<<<<<<
 * 
 *             self._custom_type_codecs[typeoid, format] = codec
*/
    __pyx_t_2 = __pyx_v_typekind;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(1, 729, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_codec->kind);
    __Pyx_DECREF(__pyx_v_codec->kind);
    __pyx_v_codec->kind = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":731
 *             codec.kind = typekind
 * 
 *             self._custom_type_codecs[typeoid, format] = codec             # <<<<<<<<<<<<<<
 *             codec_set = True
 * 
*/
    if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 731, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_typeoid);
    __Pyx_GIVEREF(__pyx_v_typeoid);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_typeoid) != (0)) __PYX_ERR(1, 731, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_format) != (0)) __PYX_ERR(1, 731, __pyx_L1_error);
    if (unlikely((PyDict_SetItem(__pyx_v_self->_custom_type_codecs, __pyx_t_2, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(1, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":732
 * 
 *             self._custom_type_codecs[typeoid, format] = codec
 *             codec_set = True             # <<<<<<<<<<<<<<
 * 
 *         if not codec_set:
*/
    __pyx_v_codec_set = 1;

    /* "asyncpg/protocol/codecs/base.pyx":716
 *             alias_oid = BUILTIN_TYPE_NAME_MAP.get(alias_to, 0)
 * 
 *         for format in formats:             # <<<<<<<<<<<<<<
 *             if alias_oid != 0:
 *                 target_codec = self.get_codec(alias_oid, format)
*/
    __pyx_L5_continue:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":734
 *             codec_set = True
 * 
 *         if not codec_set:             # <<<<<<<<<<<<<<
 *             if format == PG_FORMAT_BINARY:
 *                 codec_str = 'binary'
*/
  __pyx_t_4 = (!__pyx_v_codec_set);
  if (__pyx_t_4) {

    /* "asyncpg/protocol/codecs/base.pyx":735
 * 
 *         if not codec_set:
 *             if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 codec_str = 'binary'
 *             elif format == PG_FORMAT_TEXT:
*/
    __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_format, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 735, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 735, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/base.pyx":736
 *         if not codec_set:
 *             if format == PG_FORMAT_BINARY:
 *                 codec_str = 'binary'             # <<<<<<<<<<<<<<
 *             elif format == PG_FORMAT_TEXT:
 *                 codec_str = 'text'
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_binary);
      __pyx_v_codec_str = __pyx_mstate_global->__pyx_n_u_binary;

      /* "asyncpg/protocol/codecs/base.pyx":735
 * 
 *         if not codec_set:
 *             if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *                 codec_str = 'binary'
 *             elif format == PG_FORMAT_TEXT:
*/
      goto __pyx_L11;
    }

    /* "asyncpg/protocol/codecs/base.pyx":737
 *             if format == PG_FORMAT_BINARY:
 *                 codec_str = 'binary'
 *             elif format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                 codec_str = 'text'
 *             else:
*/
    __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/base.pyx":738
 *                 codec_str = 'binary'
 *             elif format == PG_FORMAT_TEXT:
 *                 codec_str = 'text'             # <<<<<<<<<<<<<<
 *             else:
 *                 codec_str = 'text or binary'
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_text);
      __pyx_v_codec_str = __pyx_mstate_global->__pyx_n_u_text;

      /* "asyncpg/protocol/codecs/base.pyx":737
 *             if format == PG_FORMAT_BINARY:
 *                 codec_str = 'binary'
 *             elif format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *                 codec_str = 'text'
 *             else:
*/
      goto __pyx_L11;
    }

    /* "asyncpg/protocol/codecs/base.pyx":740
 *                 codec_str = 'text'
 *             else:
 *                 codec_str = 'text or binary'             # <<<<<<<<<<<<<<
 * 
 *             raise exceptions.InterfaceError(
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_text_or_binary_2);
      __pyx_v_codec_str = __pyx_mstate_global->__pyx_kp_u_text_or_binary_2;
    }
    __pyx_L11:;

    /* "asyncpg/protocol/codecs/base.pyx":742
 *                 codec_str = 'text or binary'
 * 
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 f'cannot alias {typename} to {alias_to}: '
 *                 f'there is no {codec_str} codec for {alias_to}')
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":743
 * 
 *             raise exceptions.InterfaceError(
 *                 f'cannot alias {typename} to {alias_to}: '             # <<<<<<<<<<<<<<
 *                 f'there is no {codec_str} codec for {alias_to}')
 * 
*/
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_typename, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);

    /* "asyncpg/protocol/codecs/base.pyx":744
 *             raise exceptions.InterfaceError(
 *                 f'cannot alias {typename} to {alias_to}: '
 *                 f'there is no {codec_str} codec for {alias_to}')             # <<<<<<<<<<<<<<
 * 
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,
*/
    __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_alias_to, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_cannot_alias;
    __pyx_t_13[1] = __pyx_t_6;
    __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_to;
    __pyx_t_13[3] = __pyx_t_11;
    __pyx_t_13[4] = __pyx_mstate_global->__pyx_kp_u_there_is_no;
    __pyx_t_13[5] = __pyx_v_codec_str;
    __pyx_t_13[6] = __pyx_mstate_global->__pyx_kp_u_codec_for;
    __pyx_t_13[7] = __pyx_t_12;

    /* "asyncpg/protocol/codecs/base.pyx":743
 * 
 *             raise exceptions.InterfaceError(
 *                 f'cannot alias {typename} to {alias_to}: '             # <<<<<<<<<<<<<<
 *                 f'there is no {codec_str} codec for {alias_to}')
 * 
*/
    __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 8, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 4 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_codec_str) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_codec_str) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12));
    if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 742, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(1, 742, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":734
 *             codec_set = True
 * 
 *         if not codec_set:             # <<<<<<<<<<<<<<
 *             if format == PG_FORMAT_BINARY:
 *                 codec_str = 'binary'
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":697
 *         self.clear_type_cache()
 * 
 *     def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                 alias_to, format=PG_FORMAT_ANY):
 *         cdef:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig._set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF((PyObject *)__pyx_v_target_codec);
  __Pyx_XDECREF(__pyx_v_formats);
  __Pyx_XDECREF(__pyx_v_codec_str);
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":746
 *                 f'there is no {codec_str} codec for {alias_to}')
 * 
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                alias_to, format=PG_FORMAT_ANY):
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec = {"set_builtin_type_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeoid = 0;
  PyObject *__pyx_v_typename = 0;
  PyObject *__pyx_v_typeschema = 0;
  PyObject *__pyx_v_typekind = 0;
  PyObject *__pyx_v_alias_to = 0;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_builtin_type_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typeoid,&__pyx_mstate_global->__pyx_n_u_typename,&__pyx_mstate_global->__pyx_n_u_typeschema,&__pyx_mstate_global->__pyx_n_u_typekind,&__pyx_mstate_global->__pyx_n_u_alias_to,&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 746, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_builtin_type_codec", 0) < (0)) __PYX_ERR(1, 746, __pyx_L3_error)
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__5);
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, i); __PYX_ERR(1, 746, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(1, 746, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 746, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 746, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 746, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 746, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 746, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__5);
    }
    __pyx_v_typeoid = values[0];
    __pyx_v_typename = values[1];
    __pyx_v_typeschema = values[2];
    __pyx_v_typekind = values[3];
    __pyx_v_alias_to = values[4];
    __pyx_v_format = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_builtin_type_codec", 0, 5, 6, __pyx_nargs); __PYX_ERR(1, 746, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_10set_builtin_type_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, PyObject *__pyx_v_typeoid, PyObject *__pyx_v_typename, PyObject *__pyx_v_typeschema, PyObject *__pyx_v_typekind, PyObject *__pyx_v_alias_to, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_builtin_type_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":748
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,
 *                                alias_to, format=PG_FORMAT_ANY):
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                      alias_to, format)
 *         self.clear_type_cache()
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);

  /* "asyncpg/protocol/codecs/base.pyx":749
 *                                alias_to, format=PG_FORMAT_ANY):
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
 *                                      alias_to, format)             # <<<<<<<<<<<<<<
 *         self.clear_type_cache()
 * 
*/
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_typeoid, __pyx_v_typename, __pyx_v_typeschema, __pyx_v_typekind, __pyx_v_alias_to, __pyx_v_format};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_3, (7-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":750
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
 *                                      alias_to, format)
 *         self.clear_type_cache()             # <<<<<<<<<<<<<<
 * 
 *     def clear_type_cache(self):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":746
 *                 f'there is no {codec_str} codec for {alias_to}')
 * 
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                alias_to, format=PG_FORMAT_ANY):
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.set_builtin_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":752
 *         self.clear_type_cache()
 * 
 *     def clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._derived_type_codecs.clear()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache = {"clear_type_cache", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_type_cache (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear_type_cache", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clear_type_cache", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_12clear_type_cache(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/codecs/base.pyx":753
 * 
 *     def clear_type_cache(self):
 *         self._derived_type_codecs.clear()             # <<<<<<<<<<<<<<
 * 
 *     def declare_fallback_codec(self, uint32_t oid, str name, str schema):
*/
  if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
    __PYX_ERR(1, 753, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_self->_derived_type_codecs); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 753, __pyx_L1_error)

  /* "asyncpg/protocol/codecs/base.pyx":752
 *         self.clear_type_cache()
 * 
 *     def clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._derived_type_codecs.clear()
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.clear_type_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":755
 *         self._derived_type_codecs.clear()
 * 
 *     def declare_fallback_codec(self, uint32_t oid, str name, str schema):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec = {"declare_fallback_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  uint32_t __pyx_v_oid;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_schema = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("declare_fallback_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_oid,&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_schema,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 755, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "declare_fallback_codec", 0) < (0)) __PYX_ERR(1, 755, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, i); __PYX_ERR(1, 755, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 755, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 755, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 755, __pyx_L3_error)
    }
    __pyx_v_oid = __Pyx_PyLong_As_uint32_t(values[0]); if (unlikely((__pyx_v_oid == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L3_error)
    __pyx_v_name = ((PyObject*)values[1]);
    __pyx_v_schema = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("declare_fallback_codec", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 755, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.declare_fallback_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(1, 755, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), (&PyUnicode_Type), 1, "schema", 1))) __PYX_ERR(1, 755, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v_oid, __pyx_v_name, __pyx_v_schema);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_14declare_fallback_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, PyObject *__pyx_v_name, PyObject *__pyx_v_schema) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[5];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("declare_fallback_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":758
 *         cdef Codec codec
 * 
 *         if oid <= MAXBUILTINOID:             # <<<<<<<<<<<<<<
 *             # This is a BKI type, for which asyncpg has no
 *             # defined codec.  This should only happen for newly
*/
  __pyx_t_1 = (__pyx_v_oid <= 0x270F);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/codecs/base.pyx":764
 *             # asyncpg is lacking support.
 *             #
 *             raise exceptions.UnsupportedClientFeatureError(             # <<<<<<<<<<<<<<
 *                 f'unhandled standard data type {name!r} (OID {oid})')
 *         else:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":765
 *             #
 *             raise exceptions.UnsupportedClientFeatureError(
 *                 f'unhandled standard data type {name!r} (OID {oid})')             # <<<<<<<<<<<<<<
 *         else:
 *             # This is a non-BKI type, and as such, has no
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyUnicode_From_uint32_t(__pyx_v_oid, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_unhandled_standard_data_type;
    __pyx_t_7[1] = __pyx_t_4;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_OID;
    __pyx_t_7[3] = __pyx_t_6;
    __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__6;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 764, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":758
 *         cdef Codec codec
 * 
 *         if oid <= MAXBUILTINOID:             # <<<<<<<<<<<<<<
 *             # This is a BKI type, for which asyncpg has no
 *             # defined codec.  This should only happen for newly
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":773
 *             # using Connection.set_type_codec().
 *             #
 *             self._set_builtin_type_codec(oid, name, schema, 'scalar',             # <<<<<<<<<<<<<<
 *                                          TEXTOID, PG_FORMAT_TEXT)
 * 
*/
  /*else*/ {
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);

    /* "asyncpg/protocol/codecs/base.pyx":774
 *             #
 *             self._set_builtin_type_codec(oid, name, schema, 'scalar',
 *                                          TEXTOID, PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 *             codec = self.get_codec(oid, PG_FORMAT_TEXT)
*/
    __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_t_8, __pyx_v_name, __pyx_v_schema, __pyx_mstate_global->__pyx_n_u_scalar, __pyx_mstate_global->__pyx_int_25, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_callargs+__pyx_t_9, (7-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 773, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":776
 *                                          TEXTOID, PG_FORMAT_TEXT)
 * 
 *             codec = self.get_codec(oid, PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 *         return codec
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "asyncpg/protocol/codecs/base.pyx":778
 *             codec = self.get_codec(oid, PG_FORMAT_TEXT)
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((PyObject *)__pyx_v_codec);
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":755
 *         self._derived_type_codecs.clear()
 * 
 *     def declare_fallback_codec(self, uint32_t oid, str name, str schema):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.declare_fallback_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":780
 *         return codec
 * 
 *     cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format,             # <<<<<<<<<<<<<<
 *                                 bint ignore_custom_codec=False):
 *         cdef Codec codec
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args) {

  /* "asyncpg/protocol/codecs/base.pyx":781
 * 
 *     cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format,
 *                                 bint ignore_custom_codec=False):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/
  int __pyx_v_ignore_custom_codec = ((int)0);
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ignore_custom_codec = __pyx_optional_args->ignore_custom_codec;
    }
  }

  /* "asyncpg/protocol/codecs/base.pyx":784
 *         cdef Codec codec
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             codec = self.get_codec(
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
*/
  __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":785
 * 
 *         if format == PG_FORMAT_ANY:
 *             codec = self.get_codec(             # <<<<<<<<<<<<<<
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
 *             if codec is None:
*/
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.ignore_custom_codec = __pyx_v_ignore_custom_codec;
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":787
 *             codec = self.get_codec(
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 codec = self.get_codec(
 *                     oid, PG_FORMAT_TEXT, ignore_custom_codec)
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":788
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
 *             if codec is None:
 *                 codec = self.get_codec(             # <<<<<<<<<<<<<<
 *                     oid, PG_FORMAT_TEXT, ignore_custom_codec)
 *             return codec
*/
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.ignore_custom_codec = __pyx_v_ignore_custom_codec;
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":787
 *             codec = self.get_codec(
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 codec = self.get_codec(
 *                     oid, PG_FORMAT_TEXT, ignore_custom_codec)
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":790
 *                 codec = self.get_codec(
 *                     oid, PG_FORMAT_TEXT, ignore_custom_codec)
 *             return codec             # <<<<<<<<<<<<<<
 *         else:
 *             if not ignore_custom_codec:
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_codec);
    __pyx_r = __pyx_v_codec;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":784
 *         cdef Codec codec
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             codec = self.get_codec(
 *                 oid, PG_FORMAT_BINARY, ignore_custom_codec)
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":792
 *             return codec
 *         else:
 *             if not ignore_custom_codec:             # <<<<<<<<<<<<<<
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:
*/
  /*else*/ {
    __pyx_t_1 = (!__pyx_v_ignore_custom_codec);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":793
 *         else:
 *             if not ignore_custom_codec:
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)             # <<<<<<<<<<<<<<
 *                 if codec is not None:
 *                     if codec.format != format:
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":794
 *             if not ignore_custom_codec:
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:             # <<<<<<<<<<<<<<
 *                     if codec.format != format:
 *                         # The codec for this OID has been overridden by
*/
      __pyx_t_1 = (((PyObject *)__pyx_v_codec) != Py_None);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/base.pyx":795
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:
 *                     if codec.format != format:             # <<<<<<<<<<<<<<
 *                         # The codec for this OID has been overridden by
 *                         # set_{builtin}_type_codec with a different format.
*/
        __pyx_t_1 = (__pyx_v_codec->format != __pyx_v_format);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/base.pyx":799
 *                         # set_{builtin}_type_codec with a different format.
 *                         # We must respect that and not return a core codec.
 *                         return None             # <<<<<<<<<<<<<<
 *                     else:
 *                         return codec
*/
          __Pyx_XDECREF((PyObject *)__pyx_r);
          __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None);
          goto __pyx_L0;

          /* "asyncpg/protocol/codecs/base.pyx":795
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:
 *                     if codec.format != format:             # <<<<<<<<<<<<<<
 *                         # The codec for this OID has been overridden by
 *                         # set_{builtin}_type_codec with a different format.
*/
        }

        /* "asyncpg/protocol/codecs/base.pyx":801
 *                         return None
 *                     else:
 *                         return codec             # <<<<<<<<<<<<<<
 * 
 *             codec = get_core_codec(oid, format)
*/
        /*else*/ {
          __Pyx_XDECREF((PyObject *)__pyx_r);
          __Pyx_INCREF((PyObject *)__pyx_v_codec);
          __pyx_r = __pyx_v_codec;
          goto __pyx_L0;
        }

        /* "asyncpg/protocol/codecs/base.pyx":794
 *             if not ignore_custom_codec:
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:             # <<<<<<<<<<<<<<
 *                     if codec.format != format:
 *                         # The codec for this OID has been overridden by
*/
      }

      /* "asyncpg/protocol/codecs/base.pyx":792
 *             return codec
 *         else:
 *             if not ignore_custom_codec:             # <<<<<<<<<<<<<<
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_ANY)
 *                 if codec is not None:
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":803
 *                         return codec
 * 
 *             codec = get_core_codec(oid, format)             # <<<<<<<<<<<<<<
 *             if codec is not None:
 *                 return codec
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_v_format, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":804
 * 
 *             codec = get_core_codec(oid, format)
 *             if codec is not None:             # <<<<<<<<<<<<<<
 *                 return codec
 *             else:
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_codec) != Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":805
 *             codec = get_core_codec(oid, format)
 *             if codec is not None:
 *                 return codec             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
*/
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_codec);
      __pyx_r = __pyx_v_codec;
      goto __pyx_L0;

      /* "asyncpg/protocol/codecs/base.pyx":804
 * 
 *             codec = get_core_codec(oid, format)
 *             if codec is not None:             # <<<<<<<<<<<<<<
 *                 return codec
 *             else:
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":807
 *                 return codec
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return self._derived_type_codecs[oid, format]
 *                 except KeyError:
*/
    /*else*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        /*try:*/ {

          /* "asyncpg/protocol/codecs/base.pyx":808
 *             else:
 *                 try:
 *                     return self._derived_type_codecs[oid, format]             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     return None
*/
          __Pyx_XDECREF((PyObject *)__pyx_r);
          if (unlikely(__pyx_v_self->_derived_type_codecs == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(1, 808, __pyx_L9_error)
          }
          __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 808, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 808, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 808, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_2);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 808, __pyx_L9_error);
          __Pyx_GIVEREF(__pyx_t_7);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(1, 808, __pyx_L9_error);
          __pyx_t_2 = 0;
          __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_self->_derived_type_codecs, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 808, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 808, __pyx_L9_error)
          __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_7);
          __pyx_t_7 = 0;
          goto __pyx_L13_try_return;

          /* "asyncpg/protocol/codecs/base.pyx":807
 *                 return codec
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return self._derived_type_codecs[oid, format]
 *                 except KeyError:
*/
        }
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "asyncpg/protocol/codecs/base.pyx":809
 *                 try:
 *                     return self._derived_type_codecs[oid, format]
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     return None
 * 
*/
        __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
        if (__pyx_t_9) {
          __Pyx_ErrRestore(0,0,0);

          /* "asyncpg/protocol/codecs/base.pyx":810
 *                     return self._derived_type_codecs[oid, format]
 *                 except KeyError:
 *                     return None             # <<<<<<<<<<<<<<
 * 
 *     cdef inline Codec get_custom_codec(
*/
          __Pyx_XDECREF((PyObject *)__pyx_r);
          __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None);
          goto __pyx_L12_except_return;
        }
        goto __pyx_L11_except_error;

        /* "asyncpg/protocol/codecs/base.pyx":807
 *                 return codec
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     return self._derived_type_codecs[oid, format]
 *                 except KeyError:
*/
        __pyx_L11_except_error:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L13_try_return:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L0;
        __pyx_L12_except_return:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L0;
      }
    }
  }

  /* "asyncpg/protocol/codecs/base.pyx":780
 *         return codec
 * 
 *     cdef inline Codec get_codec(self, uint32_t oid, ServerDataFormat format,             # <<<<<<<<<<<<<<
 *                                 bint ignore_custom_codec=False):
 *         cdef Codec codec
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":812
 *                     return None
 * 
 *     cdef inline Codec get_custom_codec(             # <<<<<<<<<<<<<<
 *         self,
 *         uint32_t oid,
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self, uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_custom_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":819
 *         cdef Codec codec
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)
 *             if codec is None:
*/
  __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":820
 * 
 *         if format == PG_FORMAT_ANY:
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 *             if codec is None:
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_TEXT)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":821
 *         if format == PG_FORMAT_ANY:
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_TEXT)
 *         else:
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":822
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)
 *             if codec is None:
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 *         else:
 *             codec = self._custom_type_codecs.get((oid, format))
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec(__pyx_v_self, __pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 822, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":821
 *         if format == PG_FORMAT_ANY:
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_TEXT)
 *         else:
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":819
 *         cdef Codec codec
 * 
 *         if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *             codec = self.get_custom_codec(oid, PG_FORMAT_BINARY)
 *             if codec is None:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/codecs/base.pyx":824
 *                 codec = self.get_custom_codec(oid, PG_FORMAT_TEXT)
 *         else:
 *             codec = self._custom_type_codecs.get((oid, format))             # <<<<<<<<<<<<<<
 * 
 *         return codec
*/
  /*else*/ {
    if (unlikely(__pyx_v_self->_custom_type_codecs == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(1, 824, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 824, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 824, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_custom_type_codecs, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 824, __pyx_L1_error)
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/codecs/base.pyx":826
 *             codec = self._custom_type_codecs.get((oid, format))
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":812
 *                     return None
 * 
 *     cdef inline Codec get_custom_codec(             # <<<<<<<<<<<<<<
 *         self,
 *         uint32_t oid,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.get_custom_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_16__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._custom_type_codecs, self._derived_type_codecs)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->_custom_type_codecs);
  __Pyx_GIVEREF(__pyx_v_self->_custom_type_codecs);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_custom_type_codecs) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_derived_type_codecs);
  __Pyx_GIVEREF(__pyx_v_self->_derived_type_codecs);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_derived_type_codecs) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._custom_type_codecs, self._derived_type_codecs)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._custom_type_codecs, self._derived_type_codecs)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(9, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(9, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._custom_type_codecs, self._derived_type_codecs)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state
*/
  /*else*/ {
    __pyx_t_3 = (__pyx_v_self->_custom_type_codecs != ((PyObject*)Py_None));
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_self->_derived_type_codecs != ((PyObject*)Py_None));
    __pyx_t_2 = __pyx_t_3;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None
 *     if use_setstate:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_228230485);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_228230485);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_228230485) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._custom_type_codecs is not None or self._derived_type_codecs is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, None), state
 *     else:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_228230485);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_228230485);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_228230485) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_15DataCodecConfig_18__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(9, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.DataCodecConfig.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":829
 * 
 * 
 * cdef inline Codec get_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec *__pyx_optional_args) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_mstate_global->__pyx_k__7;
  void *__pyx_v_ptr;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  void *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_core_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_xformat = __pyx_optional_args->xformat;
    }
  }

  /* "asyncpg/protocol/codecs/base.pyx":833
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
 *     cdef:
 *         void *ptr = NULL             # <<<<<<<<<<<<<<
 * 
 *     if oid > MAXSUPPORTEDOID:
*/
  __pyx_v_ptr = NULL;

  /* "asyncpg/protocol/codecs/base.pyx":835
 *         void *ptr = NULL
 * 
 *     if oid > MAXSUPPORTEDOID:             # <<<<<<<<<<<<<<
 *         return None
 *     if format == PG_FORMAT_BINARY:
*/
  __pyx_t_1 = (__pyx_v_oid > 0x13D8);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":836
 * 
 *     if oid > MAXSUPPORTEDOID:
 *         return None             # <<<<<<<<<<<<<<
 *     if format == PG_FORMAT_BINARY:
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":835
 *         void *ptr = NULL
 * 
 *     if oid > MAXSUPPORTEDOID:             # <<<<<<<<<<<<<<
 *         return None
 *     if format == PG_FORMAT_BINARY:
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":837
 *     if oid > MAXSUPPORTEDOID:
 *         return None
 *     if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)
 *     elif format == PG_FORMAT_TEXT:
*/
  switch (__pyx_v_format) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY:

    /* "asyncpg/protocol/codecs/base.pyx":838
 *         return None
 *     if format == PG_FORMAT_BINARY:
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)             # <<<<<<<<<<<<<<
 *     elif format == PG_FORMAT_TEXT:
 *         ptr = (<CodecMap>codec_map).get_text_codec_ptr(oid * xformat)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), (__pyx_v_oid * __pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_ptr = __pyx_t_3;

    /* "asyncpg/protocol/codecs/base.pyx":837
 *     if oid > MAXSUPPORTEDOID:
 *         return None
 *     if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)
 *     elif format == PG_FORMAT_TEXT:
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT:

    /* "asyncpg/protocol/codecs/base.pyx":840
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)
 *     elif format == PG_FORMAT_TEXT:
 *         ptr = (<CodecMap>codec_map).get_text_codec_ptr(oid * xformat)             # <<<<<<<<<<<<<<
 * 
 *     if ptr is NULL:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), (__pyx_v_oid * __pyx_v_xformat)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_ptr = __pyx_t_3;

    /* "asyncpg/protocol/codecs/base.pyx":839
 *     if format == PG_FORMAT_BINARY:
 *         ptr = (<CodecMap>codec_map).get_binary_codec_ptr(oid * xformat)
 *     elif format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *         ptr = (<CodecMap>codec_map).get_text_codec_ptr(oid * xformat)
 * 
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":842
 *         ptr = (<CodecMap>codec_map).get_text_codec_ptr(oid * xformat)
 * 
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
*/
  __pyx_t_1 = (__pyx_v_ptr == NULL);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":843
 * 
 *     if ptr is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <Codec>ptr
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/base.pyx":842
 *         ptr = (<CodecMap>codec_map).get_text_codec_ptr(oid * xformat)
 * 
 *     if ptr is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":845
 *         return None
 *     else:
 *         return <Codec>ptr             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_ptr));
    __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_v_ptr);
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/codecs/base.pyx":829
 * 
 * 
 * cdef inline Codec get_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/

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

/* "asyncpg/protocol/codecs/base.pyx":848
 * 
 * 
 * cdef inline Codec get_any_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_any_core_codec(uint32_t __pyx_v_oid, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_any_core_codec *__pyx_optional_args) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_mstate_global->__pyx_k__8;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_get_core_codec __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_any_core_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_xformat = __pyx_optional_args->xformat;
    }
  }

  /* "asyncpg/protocol/codecs/base.pyx":855
 *         Codec codec
 * 
 *     if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)
 *         if codec is None:
*/
  __pyx_t_1 = (__pyx_v_format == __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/base.pyx":856
 * 
 *     if format == PG_FORMAT_ANY:
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)             # <<<<<<<<<<<<<<
 *         if codec is None:
 *             codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat)
*/
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.xformat = __pyx_v_xformat;
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":857
 *     if format == PG_FORMAT_ANY:
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat)
 *     else:
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/base.pyx":858
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)
 *         if codec is None:
 *             codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat)             # <<<<<<<<<<<<<<
 *     else:
 *         codec = get_core_codec(oid, format, xformat)
*/
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.xformat = __pyx_v_xformat;
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/base.pyx":857
 *     if format == PG_FORMAT_ANY:
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)
 *         if codec is None:             # <<<<<<<<<<<<<<
 *             codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat)
 *     else:
*/
    }

    /* "asyncpg/protocol/codecs/base.pyx":855
 *         Codec codec
 * 
 *     if format == PG_FORMAT_ANY:             # <<<<<<<<<<<<<<
 *         codec = get_core_codec(oid, PG_FORMAT_BINARY, xformat)
 *         if codec is None:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/codecs/base.pyx":860
 *             codec = get_core_codec(oid, PG_FORMAT_TEXT, xformat)
 *     else:
 *         codec = get_core_codec(oid, format, xformat)             # <<<<<<<<<<<<<<
 * 
 *     return codec
*/
  /*else*/ {
    __pyx_t_3.__pyx_n = 1;
    __pyx_t_3.xformat = __pyx_v_xformat;
    __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_get_core_codec(__pyx_v_oid, __pyx_v_format, &__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/codecs/base.pyx":862
 *         codec = get_core_codec(oid, format, xformat)
 * 
 *     return codec             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = __pyx_v_codec;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":848
 * 
 * 
 * cdef inline Codec get_any_core_codec(             # <<<<<<<<<<<<<<
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
*/

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

/* "asyncpg/protocol/codecs/base.pyx":865
 * 
 * 
 * cdef inline int has_core_codec(uint32_t oid):             # <<<<<<<<<<<<<<
 *     return (
 *         (<CodecMap>codec_map).get_binary_codec_ptr(oid) != NULL
*/

static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_has_core_codec(uint32_t __pyx_v_oid) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  void *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_core_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":867
 * cdef inline int has_core_codec(uint32_t oid):
 *     return (
 *         (<CodecMap>codec_map).get_binary_codec_ptr(oid) != NULL             # <<<<<<<<<<<<<<
 *         or (<CodecMap>codec_map).get_text_codec_ptr(oid) != NULL
 *     )
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), __pyx_v_oid); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != NULL);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/codecs/base.pyx":868
 *     return (
 *         (<CodecMap>codec_map).get_binary_codec_ptr(oid) != NULL
 *         or (<CodecMap>codec_map).get_text_codec_ptr(oid) != NULL             # <<<<<<<<<<<<<<
 *     )
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_2), __pyx_v_oid); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != NULL);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":865
 * 
 * 
 * cdef inline int has_core_codec(uint32_t oid):             # <<<<<<<<<<<<<<
 *     return (
 *         (<CodecMap>codec_map).get_binary_codec_ptr(oid) != NULL
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.has_core_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":872
 * 
 * 
 * cdef register_core_codec(uint32_t oid,             # <<<<<<<<<<<<<<
 *                          encode_func encode,
 *                          decode_func decode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(uint32_t __pyx_v_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_encode, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_decode, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec *__pyx_optional_args) {
  enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __pyx_v_xformat = __pyx_mstate_global->__pyx_k__9;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_core_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_xformat = __pyx_optional_args->xformat;
    }
  }

  /* "asyncpg/protocol/codecs/base.pyx":878
 *                          ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
 * 
 *     if oid > MAXSUPPORTEDOID:             # <<<<<<<<<<<<<<
 *         raise exceptions.InternalClientError(
 *             'cannot register core codec for OID {}: it is greater '
*/
  __pyx_t_1 = (__pyx_v_oid > 0x13D8);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/codecs/base.pyx":879
 * 
 *     if oid > MAXSUPPORTEDOID:
 *         raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *             'cannot register core codec for OID {}: it is greater '
 *             'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID))
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":881
 *         raise exceptions.InternalClientError(
 *             'cannot register core codec for OID {}: it is greater '
 *             'than MAXSUPPORTEDOID ({})'.format(oid, MAXSUPPORTEDOID))             # <<<<<<<<<<<<<<
 * 
 *     cdef:
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_cannot_register_core_codec_for_O;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_7, __pyx_mstate_global->__pyx_int_5080};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 879, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/base.pyx":878
 *                          ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):
 * 
 *     if oid > MAXSUPPORTEDOID:             # <<<<<<<<<<<<<<
 *         raise exceptions.InternalClientError(
 *             'cannot register core codec for OID {}: it is greater '
*/
  }

  /* "asyncpg/protocol/codecs/base.pyx":888
 *         str kind
 * 
 *     name = BUILTIN_TYPE_OID_MAP[oid]             # <<<<<<<<<<<<<<
 *     kind = 'array' if oid in ARRAY_TYPES else 'scalar'
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_oid, uint32_t, 0, __Pyx_PyLong_From_uint32_t, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(1, 888, __pyx_L1_error)
  __pyx_v_name = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":889
 * 
 *     name = BUILTIN_TYPE_OID_MAP[oid]
 *     kind = 'array' if oid in ARRAY_TYPES else 'scalar'             # <<<<<<<<<<<<<<
 * 
 *     codec = Codec(oid)
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ARRAY_TYPES); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_array);
    __pyx_t_5 = __pyx_mstate_global->__pyx_n_u_array;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scalar);
    __pyx_t_5 = __pyx_mstate_global->__pyx_n_u_scalar;
  }
  __pyx_v_kind = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":891
 *     kind = 'array' if oid in ARRAY_TYPES else 'scalar'
 * 
 *     codec = Codec(oid)             # <<<<<<<<<<<<<<
 *     codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat,
 *                encode, decode, None, None, None, None, None, None, None, 0)
*/
  __pyx_t_4 = NULL;
  __pyx_t_2 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 891, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":892
 * 
 *     codec = Codec(oid)
 *     codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat,             # <<<<<<<<<<<<<<
 *                encode, decode, None, None, None, None, None, None, None, 0)
 *     cpython.Py_INCREF(codec)  # immortalize
*/
  __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, __pyx_mstate_global->__pyx_n_u_pg_catalog, __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_v_xformat, __pyx_v_encode, __pyx_v_decode, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":894
 *     codec.init(name, 'pg_catalog', kind, CODEC_C, format, xformat,
 *                encode, decode, None, None, None, None, None, None, None, 0)
 *     cpython.Py_INCREF(codec)  # immortalize             # <<<<<<<<<<<<<<
 * 
 *     if format == PG_FORMAT_BINARY:
*/
  Py_INCREF(((PyObject *)__pyx_v_codec));

  /* "asyncpg/protocol/codecs/base.pyx":896
 *     cpython.Py_INCREF(codec)  # immortalize
 * 
 *     if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *         (<CodecMap>codec_map).set_binary_codec_ptr(oid * xformat, <void*>codec)
 *     elif format == PG_FORMAT_TEXT:
*/
  switch (__pyx_v_format) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY:

    /* "asyncpg/protocol/codecs/base.pyx":897
 * 
 *     if format == PG_FORMAT_BINARY:
 *         (<CodecMap>codec_map).set_binary_codec_ptr(oid * xformat, <void*>codec)             # <<<<<<<<<<<<<<
 *     elif format == PG_FORMAT_TEXT:
 *         (<CodecMap>codec_map).set_text_codec_ptr(oid * xformat, <void*>codec)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_5), (__pyx_v_oid * __pyx_v_xformat), ((void *)__pyx_v_codec)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 897, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":896
 *     cpython.Py_INCREF(codec)  # immortalize
 * 
 *     if format == PG_FORMAT_BINARY:             # <<<<<<<<<<<<<<
 *         (<CodecMap>codec_map).set_binary_codec_ptr(oid * xformat, <void*>codec)
 *     elif format == PG_FORMAT_TEXT:
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT:

    /* "asyncpg/protocol/codecs/base.pyx":899
 *         (<CodecMap>codec_map).set_binary_codec_ptr(oid * xformat, <void*>codec)
 *     elif format == PG_FORMAT_TEXT:
 *         (<CodecMap>codec_map).set_text_codec_ptr(oid * xformat, <void*>codec)             # <<<<<<<<<<<<<<
 *     else:
 *         raise exceptions.InternalClientError(
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_5), (__pyx_v_oid * __pyx_v_xformat), ((void *)__pyx_v_codec)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 899, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":898
 *     if format == PG_FORMAT_BINARY:
 *         (<CodecMap>codec_map).set_binary_codec_ptr(oid * xformat, <void*>codec)
 *     elif format == PG_FORMAT_TEXT:             # <<<<<<<<<<<<<<
 *         (<CodecMap>codec_map).set_text_codec_ptr(oid * xformat, <void*>codec)
 *     else:
*/
    break;
    default:

    /* "asyncpg/protocol/codecs/base.pyx":901
 *         (<CodecMap>codec_map).set_text_codec_ptr(oid * xformat, <void*>codec)
 *     else:
 *         raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *             'invalid data format: {}'.format(format))
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/base.pyx":902
 *     else:
 *         raise exceptions.InternalClientError(
 *             'invalid data format: {}'.format(format))             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_invalid_data_format;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 902, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(1, 901, __pyx_L1_error)
    break;
  }

  /* "asyncpg/protocol/codecs/base.pyx":872
 * 
 * 
 * cdef register_core_codec(uint32_t oid,             # <<<<<<<<<<<<<<
 *                          encode_func encode,
 *                          decode_func decode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.register_core_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":905
 * 
 * 
 * cdef register_extra_codec(str name,             # <<<<<<<<<<<<<<
 *                           encode_func encode,
 *                           decode_func decode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(PyObject *__pyx_v_name, __pyx_t_7asyncpg_8protocol_8protocol_encode_func __pyx_v_encode, __pyx_t_7asyncpg_8protocol_8protocol_decode_func __pyx_v_decode, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_extra_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":913
 *         str kind
 * 
 *     kind = 'scalar'             # <<<<<<<<<<<<<<
 * 
 *     codec = Codec(INVALIDOID)
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_scalar);
  __pyx_v_kind = __pyx_mstate_global->__pyx_n_u_scalar;

  /* "asyncpg/protocol/codecs/base.pyx":915
 *     kind = 'scalar'
 * 
 *     codec = Codec(INVALIDOID)             # <<<<<<<<<<<<<<
 *     codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT,
 *                encode, decode, None, None, None, None, None, None, None, 0)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 915, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":916
 * 
 *     codec = Codec(INVALIDOID)
 *     codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT,             # <<<<<<<<<<<<<<
 *                encode, decode, None, None, None, None, None, None, None, 0)
 *     (<CodecMap>codec_map).extra_codecs[name, format] = codec
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_init(__pyx_v_codec, __pyx_v_name, ((PyObject*)Py_None), __pyx_v_kind, __pyx_e_7asyncpg_8protocol_8protocol_CODEC_C, __pyx_v_format, __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT, __pyx_v_encode, __pyx_v_decode, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), Py_None, Py_None, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None), ((PyObject*)Py_None), Py_None, ((PyObject*)Py_None), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":918
 *     codec.init(name, None, kind, CODEC_C, format, PG_XFORMAT_OBJECT,
 *                encode, decode, None, None, None, None, None, None, None, 0)
 *     (<CodecMap>codec_map).extra_codecs[name, format] = codec             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 918, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name) != (0)) __PYX_ERR(1, 918, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 918, __pyx_L1_error);
  __pyx_t_2 = 0;
  if (unlikely((PyDict_SetItem(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs, __pyx_t_4, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":905
 * 
 * 
 * cdef register_extra_codec(str name,             # <<<<<<<<<<<<<<
 *                           encode_func encode,
 *                           decode_func decode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.register_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_kind);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/base.pyx":921
 * 
 * 
 * cdef inline Codec get_extra_codec(str name, ServerDataFormat format):             # <<<<<<<<<<<<<<
 *     return (<CodecMap>codec_map).extra_codecs.get((name, format))
*/

static CYTHON_INLINE struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_f_7asyncpg_8protocol_8protocol_get_extra_codec(PyObject *__pyx_v_name, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __pyx_v_format) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_extra_codec", 0);

  /* "asyncpg/protocol/codecs/base.pyx":922
 * 
 * cdef inline Codec get_extra_codec(str name, ServerDataFormat format):
 *     return (<CodecMap>codec_map).extra_codecs.get((name, format))             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_codec_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(1, 922, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name) != (0)) __PYX_ERR(1, 922, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 922, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)__pyx_t_1)->extra_codecs, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(1, 922, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/base.pyx":921
 * 
 * 
 * cdef inline Codec get_extra_codec(str name, ServerDataFormat format):             # <<<<<<<<<<<<<<
 *     return (<CodecMap>codec_map).extra_codecs.get((name, format))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.get_extra_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/textutils.pyx":8
 * 
 * 
 * cdef inline uint32_t _apg_tolower(uint32_t c):             # <<<<<<<<<<<<<<
 *     if c >= <uint32_t><Py_UCS4>'A' and c <= <uint32_t><Py_UCS4>'Z':
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'
*/

static CYTHON_INLINE uint32_t __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(uint32_t __pyx_v_c) {
  uint32_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "asyncpg/protocol/codecs/textutils.pyx":9
 * 
 * cdef inline uint32_t _apg_tolower(uint32_t c):
 *     if c >= <uint32_t><Py_UCS4>'A' and c <= <uint32_t><Py_UCS4>'Z':             # <<<<<<<<<<<<<<
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'
 *     else:
*/
  __pyx_t_2 = (__pyx_v_c >= ((uint32_t)((Py_UCS4)65)));
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_c <= ((uint32_t)((Py_UCS4)90)));
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":10
 * cdef inline uint32_t _apg_tolower(uint32_t c):
 *     if c >= <uint32_t><Py_UCS4>'A' and c <= <uint32_t><Py_UCS4>'Z':
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'             # <<<<<<<<<<<<<<
 *     else:
 *         return c
*/
    __pyx_r = ((__pyx_v_c + ((uint32_t)((Py_UCS4)97))) - ((uint32_t)((Py_UCS4)65)));
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/textutils.pyx":9
 * 
 * cdef inline uint32_t _apg_tolower(uint32_t c):
 *     if c >= <uint32_t><Py_UCS4>'A' and c <= <uint32_t><Py_UCS4>'Z':             # <<<<<<<<<<<<<<
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'
 *     else:
*/
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":12
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'
 *     else:
 *         return c             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __pyx_r = __pyx_v_c;
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":8
 * 
 * 
 * cdef inline uint32_t _apg_tolower(uint32_t c):             # <<<<<<<<<<<<<<
 *     if c >= <uint32_t><Py_UCS4>'A' and c <= <uint32_t><Py_UCS4>'Z':
 *         return c + <uint32_t><Py_UCS4>'a' - <uint32_t><Py_UCS4>'A'
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/textutils.pyx":15
 * 
 * 
 * cdef int apg_strcasecmp(const Py_UCS4 *s1, const Py_UCS4 *s2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t c1
*/

static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(Py_UCS4 const *__pyx_v_s1, Py_UCS4 const *__pyx_v_s2) {
  uint32_t __pyx_v_c1;
  uint32_t __pyx_v_c2;
  int __pyx_v_i;
  int __pyx_r;
  int __pyx_t_1;
  uint32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":19
 *         uint32_t c1
 *         uint32_t c2
 *         int i = 0             # <<<<<<<<<<<<<<
 * 
 *     while True:
*/
  __pyx_v_i = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":21
 *         int i = 0
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         c1 = s1[i]
 *         c2 = s2[i]
*/
  while (1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":22
 * 
 *     while True:
 *         c1 = s1[i]             # <<<<<<<<<<<<<<
 *         c2 = s2[i]
 * 
*/
    __pyx_v_c1 = (__pyx_v_s1[__pyx_v_i]);

    /* "asyncpg/protocol/codecs/textutils.pyx":23
 *     while True:
 *         c1 = s1[i]
 *         c2 = s2[i]             # <<<<<<<<<<<<<<
 * 
 *         if c1 != c2:
*/
    __pyx_v_c2 = (__pyx_v_s2[__pyx_v_i]);

    /* "asyncpg/protocol/codecs/textutils.pyx":25
 *         c2 = s2[i]
 * 
 *         if c1 != c2:             # <<<<<<<<<<<<<<
 *             c1 = _apg_tolower(c1)
 *             c2 = _apg_tolower(c2)
*/
    __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/textutils.pyx":26
 * 
 *         if c1 != c2:
 *             c1 = _apg_tolower(c1)             # <<<<<<<<<<<<<<
 *             c2 = _apg_tolower(c2)
 *             if c1 != c2:
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 26, __pyx_L1_error)
      __pyx_v_c1 = __pyx_t_2;

      /* "asyncpg/protocol/codecs/textutils.pyx":27
 *         if c1 != c2:
 *             c1 = _apg_tolower(c1)
 *             c2 = _apg_tolower(c2)             # <<<<<<<<<<<<<<
 *             if c1 != c2:
 *                 return <int32_t>c1 - <int32_t>c2
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 27, __pyx_L1_error)
      __pyx_v_c2 = __pyx_t_2;

      /* "asyncpg/protocol/codecs/textutils.pyx":28
 *             c1 = _apg_tolower(c1)
 *             c2 = _apg_tolower(c2)
 *             if c1 != c2:             # <<<<<<<<<<<<<<
 *                 return <int32_t>c1 - <int32_t>c2
 * 
*/
      __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/textutils.pyx":29
 *             c2 = _apg_tolower(c2)
 *             if c1 != c2:
 *                 return <int32_t>c1 - <int32_t>c2             # <<<<<<<<<<<<<<
 * 
 *         if c1 == 0 or c2 == 0:
*/
        __pyx_r = (((int32_t)__pyx_v_c1) - ((int32_t)__pyx_v_c2));
        goto __pyx_L0;

        /* "asyncpg/protocol/codecs/textutils.pyx":28
 *             c1 = _apg_tolower(c1)
 *             c2 = _apg_tolower(c2)
 *             if c1 != c2:             # <<<<<<<<<<<<<<
 *                 return <int32_t>c1 - <int32_t>c2
 * 
*/
      }

      /* "asyncpg/protocol/codecs/textutils.pyx":25
 *         c2 = s2[i]
 * 
 *         if c1 != c2:             # <<<<<<<<<<<<<<
 *             c1 = _apg_tolower(c1)
 *             c2 = _apg_tolower(c2)
*/
    }

    /* "asyncpg/protocol/codecs/textutils.pyx":31
 *                 return <int32_t>c1 - <int32_t>c2
 * 
 *         if c1 == 0 or c2 == 0:             # <<<<<<<<<<<<<<
 *             break
 * 
*/
    __pyx_t_3 = (__pyx_v_c1 == 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_c2 == 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/textutils.pyx":32
 * 
 *         if c1 == 0 or c2 == 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         i += 1
*/
      goto __pyx_L4_break;

      /* "asyncpg/protocol/codecs/textutils.pyx":31
 *                 return <int32_t>c1 - <int32_t>c2
 * 
 *         if c1 == 0 or c2 == 0:             # <<<<<<<<<<<<<<
 *             break
 * 
*/
    }

    /* "asyncpg/protocol/codecs/textutils.pyx":34
 *             break
 * 
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     return 0
*/
    __pyx_v_i = (__pyx_v_i + 1);
  }
  __pyx_L4_break:;

  /* "asyncpg/protocol/codecs/textutils.pyx":36
 *         i += 1
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/textutils.pyx":15
 * 
 * 
 * cdef int apg_strcasecmp(const Py_UCS4 *s1, const Py_UCS4 *s2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t c1
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.apg_strcasecmp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/textutils.pyx":39
 * 
 * 
 * cdef int apg_strcasecmp_char(const char *s1, const char *s2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint8_t c1
*/

static int __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(char const *__pyx_v_s1, char const *__pyx_v_s2) {
  uint8_t __pyx_v_c1;
  uint8_t __pyx_v_c2;
  int __pyx_v_i;
  int __pyx_r;
  int __pyx_t_1;
  uint32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":43
 *         uint8_t c1
 *         uint8_t c2
 *         int i = 0             # <<<<<<<<<<<<<<
 * 
 *     while True:
*/
  __pyx_v_i = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":45
 *         int i = 0
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         c1 = <uint8_t>s1[i]
 *         c2 = <uint8_t>s2[i]
*/
  while (1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":46
 * 
 *     while True:
 *         c1 = <uint8_t>s1[i]             # <<<<<<<<<<<<<<
 *         c2 = <uint8_t>s2[i]
 * 
*/
    __pyx_v_c1 = ((uint8_t)(__pyx_v_s1[__pyx_v_i]));

    /* "asyncpg/protocol/codecs/textutils.pyx":47
 *     while True:
 *         c1 = <uint8_t>s1[i]
 *         c2 = <uint8_t>s2[i]             # <<<<<<<<<<<<<<
 * 
 *         if c1 != c2:
*/
    __pyx_v_c2 = ((uint8_t)(__pyx_v_s2[__pyx_v_i]));

    /* "asyncpg/protocol/codecs/textutils.pyx":49
 *         c2 = <uint8_t>s2[i]
 * 
 *         if c1 != c2:             # <<<<<<<<<<<<<<
 *             c1 = <uint8_t>_apg_tolower(c1)
 *             c2 = <uint8_t>_apg_tolower(c2)
*/
    __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/textutils.pyx":50
 * 
 *         if c1 != c2:
 *             c1 = <uint8_t>_apg_tolower(c1)             # <<<<<<<<<<<<<<
 *             c2 = <uint8_t>_apg_tolower(c2)
 *             if c1 != c2:
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c1); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 50, __pyx_L1_error)
      __pyx_v_c1 = ((uint8_t)__pyx_t_2);

      /* "asyncpg/protocol/codecs/textutils.pyx":51
 *         if c1 != c2:
 *             c1 = <uint8_t>_apg_tolower(c1)
 *             c2 = <uint8_t>_apg_tolower(c2)             # <<<<<<<<<<<<<<
 *             if c1 != c2:
 *                 return <int8_t>c1 - <int8_t>c2
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__apg_tolower(__pyx_v_c2); if (unlikely(__pyx_t_2 == ((uint32_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 51, __pyx_L1_error)
      __pyx_v_c2 = ((uint8_t)__pyx_t_2);

      /* "asyncpg/protocol/codecs/textutils.pyx":52
 *             c1 = <uint8_t>_apg_tolower(c1)
 *             c2 = <uint8_t>_apg_tolower(c2)
 *             if c1 != c2:             # <<<<<<<<<<<<<<
 *                 return <int8_t>c1 - <int8_t>c2
 * 
*/
      __pyx_t_1 = (__pyx_v_c1 != __pyx_v_c2);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/textutils.pyx":53
 *             c2 = <uint8_t>_apg_tolower(c2)
 *             if c1 != c2:
 *                 return <int8_t>c1 - <int8_t>c2             # <<<<<<<<<<<<<<
 * 
 *         if c1 == 0 or c2 == 0:
*/
        __pyx_r = (((int8_t)__pyx_v_c1) - ((int8_t)__pyx_v_c2));
        goto __pyx_L0;

        /* "asyncpg/protocol/codecs/textutils.pyx":52
 *             c1 = <uint8_t>_apg_tolower(c1)
 *             c2 = <uint8_t>_apg_tolower(c2)
 *             if c1 != c2:             # <<<<<<<<<<<<<<
 *                 return <int8_t>c1 - <int8_t>c2
 * 
*/
      }

      /* "asyncpg/protocol/codecs/textutils.pyx":49
 *         c2 = <uint8_t>s2[i]
 * 
 *         if c1 != c2:             # <<<<<<<<<<<<<<
 *             c1 = <uint8_t>_apg_tolower(c1)
 *             c2 = <uint8_t>_apg_tolower(c2)
*/
    }

    /* "asyncpg/protocol/codecs/textutils.pyx":55
 *                 return <int8_t>c1 - <int8_t>c2
 * 
 *         if c1 == 0 or c2 == 0:             # <<<<<<<<<<<<<<
 *             break
 * 
*/
    __pyx_t_3 = (__pyx_v_c1 == 0);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = (__pyx_v_c2 == 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/textutils.pyx":56
 * 
 *         if c1 == 0 or c2 == 0:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         i += 1
*/
      goto __pyx_L4_break;

      /* "asyncpg/protocol/codecs/textutils.pyx":55
 *                 return <int8_t>c1 - <int8_t>c2
 * 
 *         if c1 == 0 or c2 == 0:             # <<<<<<<<<<<<<<
 *             break
 * 
*/
    }

    /* "asyncpg/protocol/codecs/textutils.pyx":58
 *             break
 * 
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     return 0
*/
    __pyx_v_i = (__pyx_v_i + 1);
  }
  __pyx_L4_break:;

  /* "asyncpg/protocol/codecs/textutils.pyx":60
 *         i += 1
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/textutils.pyx":39
 * 
 * 
 * cdef int apg_strcasecmp_char(const char *s1, const char *s2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint8_t c1
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.apg_strcasecmp_char", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/textutils.pyx":63
 * 
 * 
 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch):             # <<<<<<<<<<<<<<
 *     return (
 *         ch == ' ' or
*/

static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(Py_UCS4 __pyx_v_ch) {
  int __pyx_r;
  int __pyx_t_1;

  /* "asyncpg/protocol/codecs/textutils.pyx":65
 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch):
 *     return (
 *         ch == ' ' or             # <<<<<<<<<<<<<<
 *         ch == '\n' or
 *         ch == '\r' or
*/
  switch (__pyx_v_ch) {
    case 32:
    case 10:

    /* "asyncpg/protocol/codecs/textutils.pyx":66
 *     return (
 *         ch == ' ' or
 *         ch == '\n' or             # <<<<<<<<<<<<<<
 *         ch == '\r' or
 *         ch == '\t' or
*/
    case 13:

    /* "asyncpg/protocol/codecs/textutils.pyx":67
 *         ch == ' ' or
 *         ch == '\n' or
 *         ch == '\r' or             # <<<<<<<<<<<<<<
 *         ch == '\t' or
 *         ch == '\v' or
*/
    case 9:

    /* "asyncpg/protocol/codecs/textutils.pyx":68
 *         ch == '\n' or
 *         ch == '\r' or
 *         ch == '\t' or             # <<<<<<<<<<<<<<
 *         ch == '\v' or
 *         ch == '\f'
*/
    case 11:

    /* "asyncpg/protocol/codecs/textutils.pyx":69
 *         ch == '\r' or
 *         ch == '\t' or
 *         ch == '\v' or             # <<<<<<<<<<<<<<
 *         ch == '\f'
 *     )
*/
    case 12:

    /* "asyncpg/protocol/codecs/textutils.pyx":65
 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch):
 *     return (
 *         ch == ' ' or             # <<<<<<<<<<<<<<
 *         ch == '\n' or
 *         ch == '\r' or
*/
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/textutils.pyx":63
 * 
 * 
 * cdef inline bint apg_ascii_isspace(Py_UCS4 ch):             # <<<<<<<<<<<<<<
 *     return (
 *         ch == ' ' or
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/textutils.pyx":74
 * 
 * 
 * cdef Py_UCS4 *apg_parse_int32(Py_UCS4 *buf, int32_t *num):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_UCS4 *p
*/

static Py_UCS4 *__pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(Py_UCS4 *__pyx_v_buf, int32_t *__pyx_v_num) {
  Py_UCS4 *__pyx_v_p;
  int32_t __pyx_v_n;
  int32_t __pyx_v_neg;
  Py_UCS4 *__pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "asyncpg/protocol/codecs/textutils.pyx":77
 *     cdef:
 *         Py_UCS4 *p
 *         int32_t n = 0             # <<<<<<<<<<<<<<
 *         int32_t neg = 0
 * 
*/
  __pyx_v_n = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":78
 *         Py_UCS4 *p
 *         int32_t n = 0
 *         int32_t neg = 0             # <<<<<<<<<<<<<<
 * 
 *     if buf[0] == '-':
*/
  __pyx_v_neg = 0;

  /* "asyncpg/protocol/codecs/textutils.pyx":80
 *         int32_t neg = 0
 * 
 *     if buf[0] == '-':             # <<<<<<<<<<<<<<
 *         neg = 1
 *         buf += 1
*/
  __pyx_t_1 = ((__pyx_v_buf[0]) == 45);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":81
 * 
 *     if buf[0] == '-':
 *         neg = 1             # <<<<<<<<<<<<<<
 *         buf += 1
 *     elif buf[0] == '+':
*/
    __pyx_v_neg = 1;

    /* "asyncpg/protocol/codecs/textutils.pyx":82
 *     if buf[0] == '-':
 *         neg = 1
 *         buf += 1             # <<<<<<<<<<<<<<
 *     elif buf[0] == '+':
 *         buf += 1
*/
    __pyx_v_buf = (__pyx_v_buf + 1);

    /* "asyncpg/protocol/codecs/textutils.pyx":80
 *         int32_t neg = 0
 * 
 *     if buf[0] == '-':             # <<<<<<<<<<<<<<
 *         neg = 1
 *         buf += 1
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":83
 *         neg = 1
 *         buf += 1
 *     elif buf[0] == '+':             # <<<<<<<<<<<<<<
 *         buf += 1
 * 
*/
  __pyx_t_1 = ((__pyx_v_buf[0]) == 43);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":84
 *         buf += 1
 *     elif buf[0] == '+':
 *         buf += 1             # <<<<<<<<<<<<<<
 * 
 *     p = buf
*/
    __pyx_v_buf = (__pyx_v_buf + 1);

    /* "asyncpg/protocol/codecs/textutils.pyx":83
 *         neg = 1
 *         buf += 1
 *     elif buf[0] == '+':             # <<<<<<<<<<<<<<
 *         buf += 1
 * 
*/
  }
  __pyx_L3:;

  /* "asyncpg/protocol/codecs/textutils.pyx":86
 *         buf += 1
 * 
 *     p = buf             # <<<<<<<<<<<<<<
 *     while <int>p[0] >= <int><Py_UCS4>'0' and <int>p[0] <= <int><Py_UCS4>'9':
 *         n = 10 * n - (<int>p[0] - <int32_t><Py_UCS4>'0')
*/
  __pyx_v_p = __pyx_v_buf;

  /* "asyncpg/protocol/codecs/textutils.pyx":87
 * 
 *     p = buf
 *     while <int>p[0] >= <int><Py_UCS4>'0' and <int>p[0] <= <int><Py_UCS4>'9':             # <<<<<<<<<<<<<<
 *         n = 10 * n - (<int>p[0] - <int32_t><Py_UCS4>'0')
 *         p += 1
*/
  while (1) {
    __pyx_t_2 = (((int)(__pyx_v_p[0])) >= ((int)((Py_UCS4)48)));
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_2 = (((int)(__pyx_v_p[0])) <= ((int)((Py_UCS4)57)));
    __pyx_t_1 = __pyx_t_2;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_1) break;

    /* "asyncpg/protocol/codecs/textutils.pyx":88
 *     p = buf
 *     while <int>p[0] >= <int><Py_UCS4>'0' and <int>p[0] <= <int><Py_UCS4>'9':
 *         n = 10 * n - (<int>p[0] - <int32_t><Py_UCS4>'0')             # <<<<<<<<<<<<<<
 *         p += 1
 * 
*/
    __pyx_v_n = ((10 * __pyx_v_n) - (((int)(__pyx_v_p[0])) - ((int32_t)((Py_UCS4)48))));

    /* "asyncpg/protocol/codecs/textutils.pyx":89
 *     while <int>p[0] >= <int><Py_UCS4>'0' and <int>p[0] <= <int><Py_UCS4>'9':
 *         n = 10 * n - (<int>p[0] - <int32_t><Py_UCS4>'0')
 *         p += 1             # <<<<<<<<<<<<<<
 * 
 *     if p == buf:
*/
    __pyx_v_p = (__pyx_v_p + 1);
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":91
 *         p += 1
 * 
 *     if p == buf:             # <<<<<<<<<<<<<<
 *         return NULL
 * 
*/
  __pyx_t_1 = (__pyx_v_p == __pyx_v_buf);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":92
 * 
 *     if p == buf:
 *         return NULL             # <<<<<<<<<<<<<<
 * 
 *     if not neg:
*/
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/textutils.pyx":91
 *         p += 1
 * 
 *     if p == buf:             # <<<<<<<<<<<<<<
 *         return NULL
 * 
*/
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":94
 *         return NULL
 * 
 *     if not neg:             # <<<<<<<<<<<<<<
 *         n = -n
 * 
*/
  __pyx_t_1 = (!(__pyx_v_neg != 0));
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/textutils.pyx":95
 * 
 *     if not neg:
 *         n = -n             # <<<<<<<<<<<<<<
 * 
 *     num[0] = n
*/
    __pyx_v_n = (-__pyx_v_n);

    /* "asyncpg/protocol/codecs/textutils.pyx":94
 *         return NULL
 * 
 *     if not neg:             # <<<<<<<<<<<<<<
 *         n = -n
 * 
*/
  }

  /* "asyncpg/protocol/codecs/textutils.pyx":97
 *         n = -n
 * 
 *     num[0] = n             # <<<<<<<<<<<<<<
 * 
 *     return p
*/
  (__pyx_v_num[0]) = __pyx_v_n;

  /* "asyncpg/protocol/codecs/textutils.pyx":99
 *     num[0] = n
 * 
 *     return p             # <<<<<<<<<<<<<<
*/
  __pyx_r = __pyx_v_p;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/textutils.pyx":74
 * 
 * 
 * cdef Py_UCS4 *apg_parse_int32(Py_UCS4 *buf, int32_t *num):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_UCS4 *p
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":8
 * 
 * 
 * cdef init_bits_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BITOID,
 *                         <encode_func>pgproto.bits_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_bits_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":9
 * 
 * cdef init_bits_codecs():
 *     register_core_codec(BITOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bits_encode,
 *                         <decode_func>pgproto.bits_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x618, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":14
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(VARBITOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bits_encode,
 *                         <decode_func>pgproto.bits_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x61A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":8
 * 
 * 
 * cdef init_bits_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BITOID,
 *                         <encode_func>pgproto.bits_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_bits_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":20
 * 
 * 
 * cdef init_bytea_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BYTEAOID,
 *                         <encode_func>pgproto.bytea_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_bytea_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":21
 * 
 * cdef init_bytea_codecs():
 *     register_core_codec(BYTEAOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bytea_encode,
 *                         <decode_func>pgproto.bytea_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(17, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":26
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(CHAROID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bytea_encode,
 *                         <decode_func>pgproto.bytea_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(18, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":20
 * 
 * 
 * cdef init_bytea_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BYTEAOID,
 *                         <encode_func>pgproto.bytea_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_bytea_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":32
 * 
 * 
 * cdef init_datetime_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(DATEOID,
 *                         <encode_func>pgproto.date_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_register_core_codec __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_datetime_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":33
 * 
 * cdef init_datetime_codecs():
 *     register_core_codec(DATEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.date_encode,
 *                         <decode_func>pgproto.date_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":38
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(DATEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.date_encode_tuple,
 *                         <decode_func>pgproto.date_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":44
 *                         PG_XFORMAT_TUPLE)
 * 
 *     register_core_codec(TIMEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.time_encode,
 *                         <decode_func>pgproto.time_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":49
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(TIMEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.time_encode_tuple,
 *                         <decode_func>pgproto.time_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x43B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":55
 *                         PG_XFORMAT_TUPLE)
 * 
 *     register_core_codec(TIMETZOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timetz_encode,
 *                         <decode_func>pgproto.timetz_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4F2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":60
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(TIMETZOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timetz_encode_tuple,
 *                         <decode_func>pgproto.timetz_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4F2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":66
 *                         PG_XFORMAT_TUPLE)
 * 
 *     register_core_codec(TIMESTAMPOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timestamp_encode,
 *                         <decode_func>pgproto.timestamp_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x45A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":71
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(TIMESTAMPOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timestamp_encode_tuple,
 *                         <decode_func>pgproto.timestamp_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x45A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":77
 *                         PG_XFORMAT_TUPLE)
 * 
 *     register_core_codec(TIMESTAMPTZOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timestamptz_encode,
 *                         <decode_func>pgproto.timestamptz_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":82
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(TIMESTAMPTZOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.timestamp_encode_tuple,
 *                         <decode_func>pgproto.timestamp_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":88
 *                         PG_XFORMAT_TUPLE)
 * 
 *     register_core_codec(INTERVALOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.interval_encode,
 *                         <decode_func>pgproto.interval_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":93
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(INTERVALOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.interval_encode_tuple,
 *                         <decode_func>pgproto.interval_decode_tuple,
*/
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.xformat = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_TUPLE;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x4A2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":102
 *     # interpret the value, and simply return and pass it as text.
 *     #
 *     register_core_codec(ABSTIMEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":107
 *                         PG_FORMAT_TEXT)
 * 
 *     register_core_codec(RELTIMEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BF, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":112
 *                         PG_FORMAT_TEXT)
 * 
 *     register_core_codec(TINTERVALOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C0, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":32
 * 
 * 
 * cdef init_datetime_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(DATEOID,
 *                         <encode_func>pgproto.date_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_datetime_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":118
 * 
 * 
 * cdef init_float_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(FLOAT4OID,
 *                         <encode_func>pgproto.float4_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_float_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":119
 * 
 * cdef init_float_codecs():
 *     register_core_codec(FLOAT4OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.float4_encode,
 *                         <decode_func>pgproto.float4_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BC, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":124
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(FLOAT8OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.float8_encode,
 *                         <decode_func>pgproto.float8_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2BD, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":118
 * 
 * 
 * cdef init_float_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(FLOAT4OID,
 *                         <encode_func>pgproto.float4_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_float_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":130
 * 
 * 
 * cdef init_geometry_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BOXOID,
 *                         <encode_func>pgproto.box_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_geometry_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":131
 * 
 * cdef init_geometry_codecs():
 *     register_core_codec(BOXOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.box_encode,
 *                         <decode_func>pgproto.box_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25B, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":136
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(LINEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.line_encode,
 *                         <decode_func>pgproto.line_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x274, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":141
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(LSEGOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.lseg_encode,
 *                         <decode_func>pgproto.lseg_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x259, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":146
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(POINTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.point_encode,
 *                         <decode_func>pgproto.point_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x258, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":151
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(PATHOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.path_encode,
 *                         <decode_func>pgproto.path_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":156
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(POLYGONOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.poly_encode,
 *                         <decode_func>pgproto.poly_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x25C, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":161
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(CIRCLEOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.circle_encode,
 *                         <decode_func>pgproto.circle_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2CE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":130
 * 
 * 
 * cdef init_geometry_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(BOXOID,
 *                         <encode_func>pgproto.box_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_geometry_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":167
 * 
 * 
 * cdef init_hstore_codecs():             # <<<<<<<<<<<<<<
 *     register_extra_codec('pg_contrib.hstore',
 *                          <encode_func>pgproto.hstore_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_hstore_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":168
 * 
 * cdef init_hstore_codecs():
 *     register_extra_codec('pg_contrib.hstore',             # <<<<<<<<<<<<<<
 *                          <encode_func>pgproto.hstore_encode,
 *                          <decode_func>pgproto.hstore_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_extra_codec(__pyx_mstate_global->__pyx_kp_u_pg_contrib_hstore, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":167
 * 
 * 
 * cdef init_hstore_codecs():             # <<<<<<<<<<<<<<
 *     register_extra_codec('pg_contrib.hstore',
 *                          <encode_func>pgproto.hstore_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_hstore_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":174
 * 
 * 
 * cdef init_json_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(JSONOID,
 *                         <encode_func>pgproto.text_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_json_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":175
 * 
 * cdef init_json_codecs():
 *     register_core_codec(JSONOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x72, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":179
 *                         <decode_func>pgproto.text_decode,
 *                         PG_FORMAT_BINARY)
 *     register_core_codec(JSONBOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.jsonb_encode,
 *                         <decode_func>pgproto.jsonb_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xEDA, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":183
 *                         <decode_func>pgproto.jsonb_decode,
 *                         PG_FORMAT_BINARY)
 *     register_core_codec(JSONPATHOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.jsonpath_encode,
 *                         <decode_func>pgproto.jsonpath_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xFE8, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":174
 * 
 * 
 * cdef init_json_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(JSONOID,
 *                         <encode_func>pgproto.text_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_json_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":189
 * 
 * 
 * cdef init_int_codecs():             # <<<<<<<<<<<<<<
 * 
 *     register_core_codec(BOOLOID,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_int_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":191
 * cdef init_int_codecs():
 * 
 *     register_core_codec(BOOLOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bool_encode,
 *                         <decode_func>pgproto.bool_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(16, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":196
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(INT2OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.int2_encode,
 *                         <decode_func>pgproto.int2_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":201
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(INT4OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.int4_encode,
 *                         <decode_func>pgproto.int4_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(23, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":206
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(INT8OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.int8_encode,
 *                         <decode_func>pgproto.int8_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(20, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":189
 * 
 * 
 * cdef init_int_codecs():             # <<<<<<<<<<<<<<
 * 
 *     register_core_codec(BOOLOID,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_int_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":212
 * 
 * 
 * cdef init_pseudo_codecs():             # <<<<<<<<<<<<<<
 *     # Void type is returned by SELECT void_returning_function()
 *     register_core_codec(VOIDOID,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(void) {
  PyObject *__pyx_v_oid_types = NULL;
  PyObject *__pyx_v_oid_type = NULL;
  PyObject *__pyx_v_oid8_types = NULL;
  PyObject *__pyx_v_reg_types = NULL;
  PyObject *__pyx_v_reg_type = NULL;
  PyObject *__pyx_v_no_io_types = NULL;
  PyObject *__pyx_v_no_io_type = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  uint32_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_pseudo_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":214
 * cdef init_pseudo_codecs():
 *     # Void type is returned by SELECT void_returning_function()
 *     register_core_codec(VOIDOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.void_encode,
 *                         <decode_func>pgproto.void_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E6, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":220
 * 
 *     # Unknown type, always decoded as text
 *     register_core_codec(UNKNOWNOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x2C1, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":226
 * 
 *     # OID and friends
 *     oid_types = [             # <<<<<<<<<<<<<<
 *         OIDOID, XIDOID, CIDOID
 *     ]
*/
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_26);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_26);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_26) != (0)) __PYX_ERR(11, 226, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_28);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_28);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_28) != (0)) __PYX_ERR(11, 226, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_29);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_29);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_29) != (0)) __PYX_ERR(11, 226, __pyx_L1_error);
  __pyx_v_oid_types = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":230
 *     ]
 * 
 *     for oid_type in oid_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid_type,
 *                             <encode_func>pgproto.uint4_encode,
*/
  __pyx_t_1 = __pyx_v_oid_types; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 230, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid_type, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":231
 * 
 *     for oid_type in oid_types:
 *         register_core_codec(oid_type,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.uint4_encode,
 *                             <decode_func>pgproto.uint4_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 231, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":234
 *                             <encode_func>pgproto.uint4_encode,
 *                             <decode_func>pgproto.uint4_decode,
 *                             PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     # 64-bit OID types
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":230
 *     ]
 * 
 *     for oid_type in oid_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid_type,
 *                             <encode_func>pgproto.uint4_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":237
 * 
 *     # 64-bit OID types
 *     oid8_types = [             # <<<<<<<<<<<<<<
 *         XID8OID,
 *     ]
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5069);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5069);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_5069) != (0)) __PYX_ERR(11, 237, __pyx_L1_error);
  __pyx_v_oid8_types = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":241
 *     ]
 * 
 *     for oid_type in oid8_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid_type,
 *                             <encode_func>pgproto.uint8_encode,
*/
  __pyx_t_1 = __pyx_v_oid8_types; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 241, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid_type, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":242
 * 
 *     for oid_type in oid8_types:
 *         register_core_codec(oid_type,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.uint8_encode,
 *                             <decode_func>pgproto.uint8_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 242, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":245
 *                             <encode_func>pgproto.uint8_encode,
 *                             <decode_func>pgproto.uint8_decode,
 *                             PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     # reg* types -- these are really system catalog OIDs, but
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":241
 *     ]
 * 
 *     for oid_type in oid8_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid_type,
 *                             <encode_func>pgproto.uint8_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":252
 *     # useful.
 *     #
 *     reg_types = [             # <<<<<<<<<<<<<<
 *         REGPROCOID, REGPROCEDUREOID, REGOPEROID, REGOPERATOROID,
 *         REGCLASSOID, REGTYPEOID, REGCONFIGOID, REGDICTIONARYOID,
*/
  __pyx_t_1 = PyList_New(12); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_24);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_24);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_24) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2202);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2202);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_2202) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2203);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2203);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_2203) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2204);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2204);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_2204) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2205);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2205);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_2205) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2206);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2206);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_2206) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3734);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3734);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_3734) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3769);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3769);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_3769) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4089);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4089);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_mstate_global->__pyx_int_4089) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4096);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4096);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_mstate_global->__pyx_int_4096) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1790);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1790);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_mstate_global->__pyx_int_1790) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4191);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4191);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_mstate_global->__pyx_int_4191) != (0)) __PYX_ERR(11, 252, __pyx_L1_error);
  __pyx_v_reg_types = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":258
 *     ]
 * 
 *     for reg_type in reg_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(reg_type,
 *                             <encode_func>pgproto.text_encode,
*/
  __pyx_t_1 = __pyx_v_reg_types; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 258, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_reg_type, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":259
 * 
 *     for reg_type in reg_types:
 *         register_core_codec(reg_type,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_reg_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 259, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":262
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
 *                             PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 *     # cstring type is used by Postgres' I/O functions
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":258
 *     ]
 * 
 *     for reg_type in reg_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(reg_type,
 *                             <encode_func>pgproto.text_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":265
 * 
 *     # cstring type is used by Postgres' I/O functions
 *     register_core_codec(CSTRINGOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8E3, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":271
 * 
 *     # various system pseudotypes with no I/O
 *     no_io_types = [             # <<<<<<<<<<<<<<
 *         ANYOID, TRIGGEROID, EVENT_TRIGGEROID, LANGUAGE_HANDLEROID,
 *         FDW_HANDLEROID, TSM_HANDLEROID, INTERNALOID, OPAQUEOID,
*/
  __pyx_t_1 = PyList_New(21); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2276);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2276);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_2276) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2279);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2279);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_2279) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3838);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3838);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_3838) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2280);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2280);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_2280) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3115);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3115);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_3115) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3310);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3310);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_mstate_global->__pyx_int_3310) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2281);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2281);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 6, __pyx_mstate_global->__pyx_int_2281) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2282);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2282);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 7, __pyx_mstate_global->__pyx_int_2282) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2283);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2283);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 8, __pyx_mstate_global->__pyx_int_2283) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2776);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2776);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 9, __pyx_mstate_global->__pyx_int_2776) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5077);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5077);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 10, __pyx_mstate_global->__pyx_int_5077) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5078);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5078);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 11, __pyx_mstate_global->__pyx_int_5078) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5079);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5079);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 12, __pyx_mstate_global->__pyx_int_5079) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_5080);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_5080);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 13, __pyx_mstate_global->__pyx_int_5080) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4538);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4538);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 14, __pyx_mstate_global->__pyx_int_4538) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3831);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3831);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 15, __pyx_mstate_global->__pyx_int_3831) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_4537);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_4537);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 16, __pyx_mstate_global->__pyx_int_4537) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_2277);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_2277);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 17, __pyx_mstate_global->__pyx_int_2277) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_32);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_32);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 18, __pyx_mstate_global->__pyx_int_32) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_325);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_325);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 19, __pyx_mstate_global->__pyx_int_325) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_269);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_269);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 20, __pyx_mstate_global->__pyx_int_269) != (0)) __PYX_ERR(11, 271, __pyx_L1_error);
  __pyx_v_no_io_types = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":281
 *     ]
 * 
 *     register_core_codec(ANYENUMOID,             # <<<<<<<<<<<<<<
 *                         NULL,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xDAC, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":286
 *                         PG_FORMAT_TEXT)
 * 
 *     for no_io_type in no_io_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(no_io_type,
 *                             NULL,
*/
  __pyx_t_1 = __pyx_v_no_io_types; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 286, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_no_io_type, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":287
 * 
 *     for no_io_type in no_io_types:
 *         register_core_codec(no_io_type,             # <<<<<<<<<<<<<<
 *                             NULL,
 *                             NULL,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_no_io_type); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 287, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":290
 *                             NULL,
 *                             NULL,
 *                             PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 * 
 *     # ACL specification string
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, NULL, NULL, __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":286
 *                         PG_FORMAT_TEXT)
 * 
 *     for no_io_type in no_io_types:             # <<<<<<<<<<<<<<
 *         register_core_codec(no_io_type,
 *                             NULL,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":293
 * 
 *     # ACL specification string
 *     register_core_codec(ACLITEMOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x409, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":299
 * 
 *     # Postgres' serialized expression tree type
 *     register_core_codec(PG_NODE_TREEOID,             # <<<<<<<<<<<<<<
 *                         NULL,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xC2, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":305
 * 
 *     # pg_lsn type -- a pointer to a location in the XLOG.
 *     register_core_codec(PG_LSNOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.int8_encode,
 *                         <decode_func>pgproto.int8_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xC94, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":310
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(SMGROID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD2, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":317
 *     # pg_dependencies and pg_ndistinct are special types
 *     # used in pg_statistic_ext columns.
 *     register_core_codec(PG_DEPENDENCIESOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD4A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":322
 *                         PG_FORMAT_TEXT)
 * 
 *     register_core_codec(PG_NDISTINCTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xD21, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":329
 *     # pg_mcv_list is a special type used in pg_statistic_ext_data
 *     # system catalog
 *     register_core_codec(PG_MCV_LISTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.bytea_encode,
 *                         <decode_func>pgproto.bytea_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x1399, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":337
 *     # to be sent, but since I/O functions for these exist, add decoders
 *     # nonetheless.
 *     register_core_codec(PG_BRIN_BLOOM_SUMMARYOID,             # <<<<<<<<<<<<<<
 *                         NULL,
 *                         <decode_func>pgproto.bytea_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x11F8, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":342
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(PG_BRIN_MINMAX_MULTI_SUMMARYOID,             # <<<<<<<<<<<<<<
 *                         NULL,
 *                         <decode_func>pgproto.bytea_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x11F9, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":212
 * 
 * 
 * cdef init_pseudo_codecs():             # <<<<<<<<<<<<<<
 *     # Void type is returned by SELECT void_returning_function()
 *     register_core_codec(VOIDOID,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_pseudo_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oid_types);
  __Pyx_XDECREF(__pyx_v_oid_type);
  __Pyx_XDECREF(__pyx_v_oid8_types);
  __Pyx_XDECREF(__pyx_v_reg_types);
  __Pyx_XDECREF(__pyx_v_reg_type);
  __Pyx_XDECREF(__pyx_v_no_io_types);
  __Pyx_XDECREF(__pyx_v_no_io_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":348
 * 
 * 
 * cdef init_text_codecs():             # <<<<<<<<<<<<<<
 *     textoids = [
 *         NAMEOID,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(void) {
  PyObject *__pyx_v_textoids = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  uint32_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_text_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":349
 * 
 * cdef init_text_codecs():
 *     textoids = [             # <<<<<<<<<<<<<<
 *         NAMEOID,
 *         BPCHAROID,
*/
  __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_19);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_19);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_19) != (0)) __PYX_ERR(11, 349, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1042);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1042);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_1042) != (0)) __PYX_ERR(11, 349, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1043);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1043);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_int_1043) != (0)) __PYX_ERR(11, 349, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_25);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_25);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_int_25) != (0)) __PYX_ERR(11, 349, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_142);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_142);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_int_142) != (0)) __PYX_ERR(11, 349, __pyx_L1_error);
  __pyx_v_textoids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":357
 *     ]
 * 
 *     for oid in textoids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  __pyx_t_1 = __pyx_v_textoids; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 357, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":358
 * 
 *     for oid in textoids:
 *         register_core_codec(oid,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 358, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":361
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
 *                             PG_FORMAT_BINARY)             # <<<<<<<<<<<<<<
 * 
 *         register_core_codec(oid,
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":363
 *                             PG_FORMAT_BINARY)
 * 
 *         register_core_codec(oid,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 363, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":366
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
 *                             PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":357
 *     ]
 * 
 *     for oid in textoids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":348
 * 
 * 
 * cdef init_text_codecs():             # <<<<<<<<<<<<<<
 *     textoids = [
 *         NAMEOID,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_text_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_textoids);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":369
 * 
 * 
 * cdef init_tid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(TIDOID,
 *                         <encode_func>pgproto.tid_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_tid_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":370
 * 
 * cdef init_tid_codecs():
 *     register_core_codec(TIDOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.tid_encode,
 *                         <decode_func>pgproto.tid_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(27, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":369
 * 
 * 
 * cdef init_tid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(TIDOID,
 *                         <encode_func>pgproto.tid_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_tid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":376
 * 
 * 
 * cdef init_txid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(TXID_SNAPSHOTOID,
 *                         <encode_func>pgproto.pg_snapshot_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_txid_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":377
 * 
 * cdef init_txid_codecs():
 *     register_core_codec(TXID_SNAPSHOTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.pg_snapshot_encode,
 *                         <decode_func>pgproto.pg_snapshot_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB9A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":382
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(PG_SNAPSHOTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.pg_snapshot_encode,
 *                         <decode_func>pgproto.pg_snapshot_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x13AE, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":376
 * 
 * 
 * cdef init_txid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(TXID_SNAPSHOTOID,
 *                         <encode_func>pgproto.pg_snapshot_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_txid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":388
 * 
 * 
 * cdef init_tsearch_codecs():             # <<<<<<<<<<<<<<
 *     ts_oids = [
 *         TSQUERYOID,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(void) {
  PyObject *__pyx_v_ts_oids = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  uint32_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_tsearch_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":389
 * 
 * cdef init_tsearch_codecs():
 *     ts_oids = [             # <<<<<<<<<<<<<<
 *         TSQUERYOID,
 *         TSVECTOROID,
*/
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3615);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3615);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_3615) != (0)) __PYX_ERR(11, 389, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_3614);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_3614);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_3614) != (0)) __PYX_ERR(11, 389, __pyx_L1_error);
  __pyx_v_ts_oids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":394
 *     ]
 * 
 *     for oid in ts_oids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  __pyx_t_1 = __pyx_v_ts_oids; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 394, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":395
 * 
 *     for oid in ts_oids:
 *         register_core_codec(oid,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 395, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":398
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
 *                             PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 *     register_core_codec(GTSVECTOROID,
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":394
 *     ]
 * 
 *     for oid in ts_oids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":400
 *                             PG_FORMAT_TEXT)
 * 
 *     register_core_codec(GTSVECTOROID,             # <<<<<<<<<<<<<<
 *                         NULL,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xE3A, NULL, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":388
 * 
 * 
 * cdef init_tsearch_codecs():             # <<<<<<<<<<<<<<
 *     ts_oids = [
 *         TSQUERYOID,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_tsearch_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ts_oids);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":406
 * 
 * 
 * cdef init_uuid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(UUIDOID,
 *                         <encode_func>pgproto.uuid_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_uuid_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":407
 * 
 * cdef init_uuid_codecs():
 *     register_core_codec(UUIDOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.uuid_encode,
 *                         <decode_func>pgproto.uuid_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0xB86, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":406
 * 
 * 
 * cdef init_uuid_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(UUIDOID,
 *                         <encode_func>pgproto.uuid_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_uuid_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":413
 * 
 * 
 * cdef init_numeric_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(NUMERICOID,
 *                         <encode_func>pgproto.numeric_encode_text,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_numeric_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":414
 * 
 * cdef init_numeric_codecs():
 *     register_core_codec(NUMERICOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.numeric_encode_text,
 *                         <decode_func>pgproto.numeric_decode_text,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x6A4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":419
 *                         PG_FORMAT_TEXT)
 * 
 *     register_core_codec(NUMERICOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.numeric_encode_binary,
 *                         <decode_func>pgproto.numeric_decode_binary,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x6A4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":413
 * 
 * 
 * cdef init_numeric_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(NUMERICOID,
 *                         <encode_func>pgproto.numeric_encode_text,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_numeric_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":425
 * 
 * 
 * cdef init_network_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(CIDROID,
 *                         <encode_func>pgproto.cidr_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_network_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":426
 * 
 * cdef init_network_codecs():
 *     register_core_codec(CIDROID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.cidr_encode,
 *                         <decode_func>pgproto.cidr_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x28A, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":431
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(INETOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.inet_encode,
 *                         <decode_func>pgproto.inet_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x365, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":436
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(MACADDROID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x33D, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":441
 *                         PG_FORMAT_TEXT)
 * 
 *     register_core_codec(MACADDR8OID,             # <<<<<<<<<<<<<<
 *                         <encode_func>pgproto.text_encode,
 *                         <decode_func>pgproto.text_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x306, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":425
 * 
 * 
 * cdef init_network_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(CIDROID,
 *                         <encode_func>pgproto.cidr_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_network_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":447
 * 
 * 
 * cdef init_monetary_codecs():             # <<<<<<<<<<<<<<
 *     moneyoids = [
 *         MONEYOID,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(void) {
  PyObject *__pyx_v_moneyoids = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  uint32_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_monetary_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":448
 * 
 * cdef init_monetary_codecs():
 *     moneyoids = [             # <<<<<<<<<<<<<<
 *         MONEYOID,
 *     ]
*/
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_790);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_790);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_790) != (0)) __PYX_ERR(11, 448, __pyx_L1_error);
  __pyx_v_moneyoids = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":452
 *     ]
 * 
 *     for oid in moneyoids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  __pyx_t_1 = __pyx_v_moneyoids; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 452, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":453
 * 
 *     for oid in moneyoids:
 *         register_core_codec(oid,             # <<<<<<<<<<<<<<
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(11, 453, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/pgproto.pyx":456
 *                             <encode_func>pgproto.text_encode,
 *                             <decode_func>pgproto.text_decode,
 *                             PG_FORMAT_TEXT)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(__pyx_t_4, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_TEXT, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/pgproto.pyx":452
 *     ]
 * 
 *     for oid in moneyoids:             # <<<<<<<<<<<<<<
 *         register_core_codec(oid,
 *                             <encode_func>pgproto.text_encode,
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":447
 * 
 * 
 * cdef init_monetary_codecs():             # <<<<<<<<<<<<<<
 *     moneyoids = [
 *         MONEYOID,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_monetary_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_moneyoids);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/pgproto.pyx":459
 * 
 * 
 * cdef init_all_pgproto_codecs():             # <<<<<<<<<<<<<<
 *     # Builtin types, in lexicographical order.
 *     init_bits_codecs()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_all_pgproto_codecs", 0);

  /* "asyncpg/protocol/codecs/pgproto.pyx":461
 * cdef init_all_pgproto_codecs():
 *     # Builtin types, in lexicographical order.
 *     init_bits_codecs()             # <<<<<<<<<<<<<<
 *     init_bytea_codecs()
 *     init_datetime_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_bits_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":462
 *     # Builtin types, in lexicographical order.
 *     init_bits_codecs()
 *     init_bytea_codecs()             # <<<<<<<<<<<<<<
 *     init_datetime_codecs()
 *     init_float_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_bytea_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":463
 *     init_bits_codecs()
 *     init_bytea_codecs()
 *     init_datetime_codecs()             # <<<<<<<<<<<<<<
 *     init_float_codecs()
 *     init_geometry_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_datetime_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":464
 *     init_bytea_codecs()
 *     init_datetime_codecs()
 *     init_float_codecs()             # <<<<<<<<<<<<<<
 *     init_geometry_codecs()
 *     init_int_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_float_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":465
 *     init_datetime_codecs()
 *     init_float_codecs()
 *     init_geometry_codecs()             # <<<<<<<<<<<<<<
 *     init_int_codecs()
 *     init_json_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_geometry_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":466
 *     init_float_codecs()
 *     init_geometry_codecs()
 *     init_int_codecs()             # <<<<<<<<<<<<<<
 *     init_json_codecs()
 *     init_monetary_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_int_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":467
 *     init_geometry_codecs()
 *     init_int_codecs()
 *     init_json_codecs()             # <<<<<<<<<<<<<<
 *     init_monetary_codecs()
 *     init_network_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_json_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":468
 *     init_int_codecs()
 *     init_json_codecs()
 *     init_monetary_codecs()             # <<<<<<<<<<<<<<
 *     init_network_codecs()
 *     init_numeric_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_monetary_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":469
 *     init_json_codecs()
 *     init_monetary_codecs()
 *     init_network_codecs()             # <<<<<<<<<<<<<<
 *     init_numeric_codecs()
 *     init_text_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_network_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":470
 *     init_monetary_codecs()
 *     init_network_codecs()
 *     init_numeric_codecs()             # <<<<<<<<<<<<<<
 *     init_text_codecs()
 *     init_tid_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_numeric_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":471
 *     init_network_codecs()
 *     init_numeric_codecs()
 *     init_text_codecs()             # <<<<<<<<<<<<<<
 *     init_tid_codecs()
 *     init_tsearch_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_text_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":472
 *     init_numeric_codecs()
 *     init_text_codecs()
 *     init_tid_codecs()             # <<<<<<<<<<<<<<
 *     init_tsearch_codecs()
 *     init_txid_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_tid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":473
 *     init_text_codecs()
 *     init_tid_codecs()
 *     init_tsearch_codecs()             # <<<<<<<<<<<<<<
 *     init_txid_codecs()
 *     init_uuid_codecs()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_tsearch_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":474
 *     init_tid_codecs()
 *     init_tsearch_codecs()
 *     init_txid_codecs()             # <<<<<<<<<<<<<<
 *     init_uuid_codecs()
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_txid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":475
 *     init_tsearch_codecs()
 *     init_txid_codecs()
 *     init_uuid_codecs()             # <<<<<<<<<<<<<<
 * 
 *     # Various pseudotypes and system types
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_uuid_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":478
 * 
 *     # Various pseudotypes and system types
 *     init_pseudo_codecs()             # <<<<<<<<<<<<<<
 * 
 *     # contrib
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_pseudo_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":481
 * 
 *     # contrib
 *     init_hstore_codecs()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_init_hstore_codecs(); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/pgproto.pyx":459
 * 
 * 
 * cdef init_all_pgproto_codecs():             # <<<<<<<<<<<<<<
 *     # Builtin types, in lexicographical order.
 *     init_bits_codecs()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_all_pgproto_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":32
 * 
 * 
 * cdef inline bint _is_trivial_container(object obj):             # <<<<<<<<<<<<<<
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
*/

static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(PyObject *__pyx_v_obj) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "asyncpg/protocol/codecs/array.pyx":33
 * 
 * cdef inline bint _is_trivial_container(object obj):
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \             # <<<<<<<<<<<<<<
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
 * 
*/
  __pyx_t_2 = PyUnicode_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/codecs/array.pyx":34
 * cdef inline bint _is_trivial_container(object obj):
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (PyByteArray_Check(__pyx_v_obj) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (PyMemoryView_Check(__pyx_v_obj) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":32
 * 
 * 
 * cdef inline bint _is_trivial_container(object obj):             # <<<<<<<<<<<<<<
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":37
 * 
 * 
 * cdef inline _is_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, IterableABC) and
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_array_iterable", 0);

  /* "asyncpg/protocol/codecs/array.pyx":38
 * 
 * cdef inline _is_array_iterable(object obj):
 *     return (             # <<<<<<<<<<<<<<
 *         isinstance(obj, IterableABC) and
 *         isinstance(obj, SizedABC) and
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/codecs/array.pyx":39
 * cdef inline _is_array_iterable(object obj):
 *     return (
 *         isinstance(obj, IterableABC) and             # <<<<<<<<<<<<<<
 *         isinstance(obj, SizedABC) and
 *         not _is_trivial_container(obj) and
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_IterableABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/codecs/array.pyx":40
 *     return (
 *         isinstance(obj, IterableABC) and
 *         isinstance(obj, SizedABC) and             # <<<<<<<<<<<<<<
 *         not _is_trivial_container(obj) and
 *         not isinstance(obj, MappingABC)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SizedABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/codecs/array.pyx":41
 *         isinstance(obj, IterableABC) and
 *         isinstance(obj, SizedABC) and
 *         not _is_trivial_container(obj) and             # <<<<<<<<<<<<<<
 *         not isinstance(obj, MappingABC)
 *     )
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__is_trivial_container(__pyx_v_obj); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 41, __pyx_L1_error)
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/codecs/array.pyx":42
 *         isinstance(obj, SizedABC) and
 *         not _is_trivial_container(obj) and
 *         not isinstance(obj, MappingABC)             # <<<<<<<<<<<<<<
 *     )
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MappingABC); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (!__pyx_t_4);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":37
 * 
 * 
 * cdef inline _is_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     return (
 *         isinstance(obj, IterableABC) and
*/

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

/* "asyncpg/protocol/codecs/array.pyx":46
 * 
 * 
 * cdef inline _is_sub_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     # Sub-arrays have a specialized check, because we treat
 *     # nested tuples as records.
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_sub_array_iterable", 0);

  /* "asyncpg/protocol/codecs/array.pyx":49
 *     # Sub-arrays have a specialized check, because we treat
 *     # nested tuples as records.
 *     return _is_array_iterable(obj) and not cpython.PyTuple_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 49, __pyx_L1_error)
  if (__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = (!PyTuple_Check(__pyx_v_obj));
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":46
 * 
 * 
 * cdef inline _is_sub_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     # Sub-arrays have a specialized check, because we treat
 *     # nested tuples as records.
*/

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

/* "asyncpg/protocol/codecs/array.pyx":52
 * 
 * 
 * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ssize_t mylen = len(obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(PyObject *__pyx_v_obj, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) {
  Py_ssize_t __pyx_v_mylen;
  Py_ssize_t __pyx_v_elemlen;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  long __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_array_shape", 0);

  /* "asyncpg/protocol/codecs/array.pyx":54
 * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims):
 *     cdef:
 *         ssize_t mylen = len(obj)             # <<<<<<<<<<<<<<
 *         ssize_t elemlen = -2
 *         object it
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 54, __pyx_L1_error)
  __pyx_v_mylen = __pyx_t_1;

  /* "asyncpg/protocol/codecs/array.pyx":55
 *     cdef:
 *         ssize_t mylen = len(obj)
 *         ssize_t elemlen = -2             # <<<<<<<<<<<<<<
 *         object it
 * 
*/
  __pyx_v_elemlen = -2L;

  /* "asyncpg/protocol/codecs/array.pyx":58
 *         object it
 * 
 *     if mylen > _MAXINT32:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in array value')
 * 
*/
  __pyx_t_2 = (__pyx_v_mylen > 0x7FFFFFFF);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/array.pyx":59
 * 
 *     if mylen > _MAXINT32:
 *         raise ValueError('too many elements in array value')             # <<<<<<<<<<<<<<
 * 
 *     if ndims[0] > ARRAY_MAXDIM:
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 59, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 59, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":58
 *         object it
 * 
 *     if mylen > _MAXINT32:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in array value')
 * 
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":61
 *         raise ValueError('too many elements in array value')
 * 
 *     if ndims[0] > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
*/
  __pyx_t_2 = ((__pyx_v_ndims[0]) > 6);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/array.pyx":62
 * 
 *     if ndims[0] > ARRAY_MAXDIM:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *                 format(ndims[0], ARRAY_MAXDIM))
*/
    __pyx_t_4 = NULL;

    /* "asyncpg/protocol/codecs/array.pyx":64
 *         raise ValueError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *                 format(ndims[0], ARRAY_MAXDIM))             # <<<<<<<<<<<<<<
 * 
 *     dims[ndims[0] - 1] = <int32_t>mylen
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyLong_From_int32_t((__pyx_v_ndims[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_6};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 62, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":61
 *         raise ValueError('too many elements in array value')
 * 
 *     if ndims[0] > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":66
 *                 format(ndims[0], ARRAY_MAXDIM))
 * 
 *     dims[ndims[0] - 1] = <int32_t>mylen             # <<<<<<<<<<<<<<
 * 
 *     for elem in obj:
*/
  (__pyx_v_dims[((__pyx_v_ndims[0]) - 1)]) = ((int32_t)__pyx_v_mylen);

  /* "asyncpg/protocol/codecs/array.pyx":68
 *     dims[ndims[0] - 1] = <int32_t>mylen
 * 
 *     for elem in obj:             # <<<<<<<<<<<<<<
 *         if _is_sub_array_iterable(elem):
 *             if elemlen == -2:
*/
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_3 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 68, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 68, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 68, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 68, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_9(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 68, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":69
 * 
 *     for elem in obj:
 *         if _is_sub_array_iterable(elem):             # <<<<<<<<<<<<<<
 *             if elemlen == -2:
 *                 elemlen = len(elem)
*/
    __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol__is_sub_array_iterable(__pyx_v_elem); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 69, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_2) {

      /* "asyncpg/protocol/codecs/array.pyx":70
 *     for elem in obj:
 *         if _is_sub_array_iterable(elem):
 *             if elemlen == -2:             # <<<<<<<<<<<<<<
 *                 elemlen = len(elem)
 *                 if elemlen > _MAXINT32:
*/
      __pyx_t_2 = (__pyx_v_elemlen == -2L);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":71
 *         if _is_sub_array_iterable(elem):
 *             if elemlen == -2:
 *                 elemlen = len(elem)             # <<<<<<<<<<<<<<
 *                 if elemlen > _MAXINT32:
 *                     raise ValueError('too many elements in array value')
*/
        __pyx_t_10 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(2, 71, __pyx_L1_error)
        __pyx_v_elemlen = __pyx_t_10;

        /* "asyncpg/protocol/codecs/array.pyx":72
 *             if elemlen == -2:
 *                 elemlen = len(elem)
 *                 if elemlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *                     raise ValueError('too many elements in array value')
 *                 ndims[0] += 1
*/
        __pyx_t_2 = (__pyx_v_elemlen > 0x7FFFFFFF);
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":73
 *                 elemlen = len(elem)
 *                 if elemlen > _MAXINT32:
 *                     raise ValueError('too many elements in array value')             # <<<<<<<<<<<<<<
 *                 ndims[0] += 1
 *                 _get_array_shape(elem, dims, ndims)
*/
          __pyx_t_4 = NULL;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 73, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(2, 73, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":72
 *             if elemlen == -2:
 *                 elemlen = len(elem)
 *                 if elemlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *                     raise ValueError('too many elements in array value')
 *                 ndims[0] += 1
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":74
 *                 if elemlen > _MAXINT32:
 *                     raise ValueError('too many elements in array value')
 *                 ndims[0] += 1             # <<<<<<<<<<<<<<
 *                 _get_array_shape(elem, dims, ndims)
 *             else:
*/
        __pyx_t_11 = 0;
        (__pyx_v_ndims[__pyx_t_11]) = ((__pyx_v_ndims[__pyx_t_11]) + 1);

        /* "asyncpg/protocol/codecs/array.pyx":75
 *                     raise ValueError('too many elements in array value')
 *                 ndims[0] += 1
 *                 _get_array_shape(elem, dims, ndims)             # <<<<<<<<<<<<<<
 *             else:
 *                 if len(elem) != elemlen:
*/
        __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_elem, __pyx_v_dims, __pyx_v_ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 75, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":70
 *     for elem in obj:
 *         if _is_sub_array_iterable(elem):
 *             if elemlen == -2:             # <<<<<<<<<<<<<<
 *                 elemlen = len(elem)
 *                 if elemlen > _MAXINT32:
*/
        goto __pyx_L8;
      }

      /* "asyncpg/protocol/codecs/array.pyx":77
 *                 _get_array_shape(elem, dims, ndims)
 *             else:
 *                 if len(elem) != elemlen:             # <<<<<<<<<<<<<<
 *                     raise ValueError('non-homogeneous array')
 *         else:
*/
      /*else*/ {
        __pyx_t_10 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(2, 77, __pyx_L1_error)
        __pyx_t_2 = (__pyx_t_10 != __pyx_v_elemlen);
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":78
 *             else:
 *                 if len(elem) != elemlen:
 *                     raise ValueError('non-homogeneous array')             # <<<<<<<<<<<<<<
 *         else:
 *             if elemlen >= 0:
*/
          __pyx_t_4 = NULL;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_non_homogeneous_array};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 78, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(2, 78, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":77
 *                 _get_array_shape(elem, dims, ndims)
 *             else:
 *                 if len(elem) != elemlen:             # <<<<<<<<<<<<<<
 *                     raise ValueError('non-homogeneous array')
 *         else:
*/
        }
      }
      __pyx_L8:;

      /* "asyncpg/protocol/codecs/array.pyx":69
 * 
 *     for elem in obj:
 *         if _is_sub_array_iterable(elem):             # <<<<<<<<<<<<<<
 *             if elemlen == -2:
 *                 elemlen = len(elem)
*/
      goto __pyx_L7;
    }

    /* "asyncpg/protocol/codecs/array.pyx":80
 *                     raise ValueError('non-homogeneous array')
 *         else:
 *             if elemlen >= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('non-homogeneous array')
 *             else:
*/
    /*else*/ {
      __pyx_t_2 = (__pyx_v_elemlen >= 0);
      if (unlikely(__pyx_t_2)) {

        /* "asyncpg/protocol/codecs/array.pyx":81
 *         else:
 *             if elemlen >= 0:
 *                 raise ValueError('non-homogeneous array')             # <<<<<<<<<<<<<<
 *             else:
 *                 elemlen = -1
*/
        __pyx_t_4 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_non_homogeneous_array};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 81, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(2, 81, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/array.pyx":80
 *                     raise ValueError('non-homogeneous array')
 *         else:
 *             if elemlen >= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('non-homogeneous array')
 *             else:
*/
      }

      /* "asyncpg/protocol/codecs/array.pyx":83
 *                 raise ValueError('non-homogeneous array')
 *             else:
 *                 elemlen = -1             # <<<<<<<<<<<<<<
 * 
 * 
*/
      /*else*/ {
        __pyx_v_elemlen = -1L;
      }
    }
    __pyx_L7:;

    /* "asyncpg/protocol/codecs/array.pyx":68
 *     dims[ndims[0] - 1] = <int32_t>mylen
 * 
 *     for elem in obj:             # <<<<<<<<<<<<<<
 *         if _is_sub_array_iterable(elem):
 *             if elemlen == -2:
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":52
 * 
 * 
 * cdef _get_array_shape(object obj, int32_t *dims, int32_t *ndims):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ssize_t mylen = len(obj)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._get_array_shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":86
 * 
 * 
 * cdef _write_array_data(ConnectionSettings settings, object obj, int32_t ndims,             # <<<<<<<<<<<<<<
 *                        int32_t dim, WriteBuffer elem_data,
 *                        encode_func_ex encoder, const void *encoder_arg):
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_array_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, PyObject *__pyx_v_obj, int32_t __pyx_v_ndims, int32_t __pyx_v_dim, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) {
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  size_t __pyx_t_18;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_array_data", 0);

  /* "asyncpg/protocol/codecs/array.pyx":89
 *                        int32_t dim, WriteBuffer elem_data,
 *                        encode_func_ex encoder, const void *encoder_arg):
 *     if dim < ndims - 1:             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             _write_array_data(settings, item, ndims, dim + 1, elem_data,
*/
  __pyx_t_1 = (__pyx_v_dim < (__pyx_v_ndims - 1));
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/array.pyx":90
 *                        encode_func_ex encoder, const void *encoder_arg):
 *     if dim < ndims - 1:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             _write_array_data(settings, item, ndims, dim + 1, elem_data,
 *                               encoder, encoder_arg)
*/
    if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
      __pyx_t_2 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 90, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 90, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 90, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 90, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 90, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":91
 *     if dim < ndims - 1:
 *         for item in obj:
 *             _write_array_data(settings, item, ndims, dim + 1, elem_data,             # <<<<<<<<<<<<<<
 *                               encoder, encoder_arg)
 *     else:
*/
      __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol__write_array_data(__pyx_v_settings, __pyx_v_item, __pyx_v_ndims, (__pyx_v_dim + 1), __pyx_v_elem_data, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":90
 *                        encode_func_ex encoder, const void *encoder_arg):
 *     if dim < ndims - 1:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             _write_array_data(settings, item, ndims, dim + 1, elem_data,
 *                               encoder, encoder_arg)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":89
 *                        int32_t dim, WriteBuffer elem_data,
 *                        encode_func_ex encoder, const void *encoder_arg):
 *     if dim < ndims - 1:             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             _write_array_data(settings, item, ndims, dim + 1, elem_data,
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/codecs/array.pyx":94
 *                               encoder, encoder_arg)
 *     else:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
*/
  /*else*/ {
    if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
      __pyx_t_2 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 94, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 94, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 94, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 94, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 94, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 94, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":95
 *     else:
 *         for item in obj:
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
      __pyx_t_1 = (__pyx_v_item == Py_None);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":96
 *         for item in obj:
 *             if item is None:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
*/
        __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 96, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":95
 *     else:
 *         for item in obj:
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":98
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
      /*else*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          /*try:*/ {

            /* "asyncpg/protocol/codecs/array.pyx":99
 *             else:
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)             # <<<<<<<<<<<<<<
 *                 except TypeError as e:
 *                     raise ValueError(
*/
            __pyx_t_5 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 99, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "asyncpg/protocol/codecs/array.pyx":98
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L17_try_end;
          __pyx_L10_error:;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":100
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(e.args[0])) from None
*/
          __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
          if (__pyx_t_9) {
            __Pyx_AddTraceback("asyncpg.protocol.protocol._write_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(2, 100, __pyx_L12_except_error)
            __Pyx_XGOTREF(__pyx_t_5);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_10);
            __pyx_v_e = __pyx_t_10;
            /*try:*/ {

              /* "asyncpg/protocol/codecs/array.pyx":101
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'invalid array element: {}'.format(e.args[0])) from None
 * 
*/
              __pyx_t_13 = NULL;

              /* "asyncpg/protocol/codecs/array.pyx":102
 *                 except TypeError as e:
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 * 
*/
              __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element;
              __Pyx_INCREF(__pyx_t_15);
              __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 102, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_16);
              __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 102, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              __pyx_t_18 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17};
                __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 102, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_14);
              }
              __pyx_t_18 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
                __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 101, __pyx_L23_error)
                __Pyx_GOTREF(__pyx_t_12);
              }
              __Pyx_Raise(__pyx_t_12, 0, 0, Py_None);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __PYX_ERR(2, 101, __pyx_L23_error)
            }

            /* "asyncpg/protocol/codecs/array.pyx":100
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(e.args[0])) from None
*/
            /*finally:*/ {
              __pyx_L23_error:;
              /*exception exit:*/{
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                 __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
                if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
                __Pyx_XGOTREF(__pyx_t_21);
                __Pyx_XGOTREF(__pyx_t_22);
                __Pyx_XGOTREF(__pyx_t_23);
                __Pyx_XGOTREF(__pyx_t_24);
                __Pyx_XGOTREF(__pyx_t_25);
                __Pyx_XGOTREF(__pyx_t_26);
                __pyx_t_9 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
                {
                  __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
                }
                __Pyx_XGIVEREF(__pyx_t_24);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_21);
                __Pyx_XGIVEREF(__pyx_t_22);
                __Pyx_XGIVEREF(__pyx_t_23);
                __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
                __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
                goto __pyx_L12_except_error;
              }
            }
          }
          goto __pyx_L12_except_error;

          /* "asyncpg/protocol/codecs/array.pyx":98
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
          __pyx_L12_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L17_try_end:;
        }
      }
      __pyx_L9:;

      /* "asyncpg/protocol/codecs/array.pyx":94
 *                               encoder, encoder_arg)
 *     else:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/codecs/array.pyx":86
 * 
 * 
 * cdef _write_array_data(ConnectionSettings settings, object obj, int32_t ndims,             # <<<<<<<<<<<<<<
 *                        int32_t dim, WriteBuffer elem_data,
 *                        encode_func_ex encoder, const void *encoder_arg):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._write_array_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":105
 * 
 * 
 * cdef inline array_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                          object obj, uint32_t elem_oid,
 *                          encode_func_ex encoder, const void *encoder_arg):
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  int32_t __pyx_v_dims[6];
  int32_t __pyx_v_ndims;
  int32_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int32_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  char const *__pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  int32_t __pyx_t_30;
  int32_t __pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_encode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":111
 *         WriteBuffer elem_data
 *         int32_t dims[ARRAY_MAXDIM]
 *         int32_t ndims = 1             # <<<<<<<<<<<<<<
 *         int32_t i
 * 
*/
  __pyx_v_ndims = 1;

  /* "asyncpg/protocol/codecs/array.pyx":114
 *         int32_t i
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/codecs/array.pyx":115
 * 
 *     if not _is_array_iterable(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))
*/
    __pyx_t_4 = NULL;

    /* "asyncpg/protocol/codecs/array.pyx":116
 *     if not _is_array_iterable(obj):
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj).__name__))
 * 
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec;
    __Pyx_INCREF(__pyx_t_6);

    /* "asyncpg/protocol/codecs/array.pyx":117
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *     _get_array_shape(obj, dims, &ndims)
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 115, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":114
 *         int32_t i
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":119
 *                 type(obj).__name__))
 * 
 *     _get_array_shape(obj, dims, &ndims)             # <<<<<<<<<<<<<<
 * 
 *     elem_data = WriteBuffer.new()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":121
 *     _get_array_shape(obj, dims, &ndims)
 * 
 *     elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *     if ndims > 1:
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":123
 *     elem_data = WriteBuffer.new()
 * 
 *     if ndims > 1:             # <<<<<<<<<<<<<<
 *         _write_array_data(settings, obj, ndims, 0, elem_data,
 *                           encoder, encoder_arg)
*/
  __pyx_t_3 = (__pyx_v_ndims > 1);
  if (__pyx_t_3) {

    /* "asyncpg/protocol/codecs/array.pyx":124
 * 
 *     if ndims > 1:
 *         _write_array_data(settings, obj, ndims, 0, elem_data,             # <<<<<<<<<<<<<<
 *                           encoder, encoder_arg)
 *     else:
*/
    __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__write_array_data(__pyx_v_settings, __pyx_v_obj, __pyx_v_ndims, 0, __pyx_v_elem_data, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":123
 *     elem_data = WriteBuffer.new()
 * 
 *     if ndims > 1:             # <<<<<<<<<<<<<<
 *         _write_array_data(settings, obj, ndims, 0, elem_data,
 *                           encoder, encoder_arg)
*/
    goto __pyx_L4;
  }

  /* "asyncpg/protocol/codecs/array.pyx":127
 *                           encoder, encoder_arg)
 *     else:
 *         for i, item in enumerate(obj):             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
*/
  /*else*/ {
    __pyx_t_9 = 0;
    if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
      __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 127, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 127, __pyx_L1_error)
            #endif
            if (__pyx_t_10 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_10;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 127, __pyx_L1_error)
            #endif
            if (__pyx_t_10 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10);
          #endif
          ++__pyx_t_10;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 127, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_11(__pyx_t_1);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 127, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_v_i = __pyx_t_9;
      __pyx_t_9 = (__pyx_t_9 + 1);

      /* "asyncpg/protocol/codecs/array.pyx":128
 *     else:
 *         for i, item in enumerate(obj):
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
      __pyx_t_3 = (__pyx_v_item == Py_None);
      if (__pyx_t_3) {

        /* "asyncpg/protocol/codecs/array.pyx":129
 *         for i, item in enumerate(obj):
 *             if item is None:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
*/
        __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 129, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":128
 *     else:
 *         for i, item in enumerate(obj):
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
*/
        goto __pyx_L7;
      }

      /* "asyncpg/protocol/codecs/array.pyx":131
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
      /*else*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          /*try:*/ {

            /* "asyncpg/protocol/codecs/array.pyx":132
 *             else:
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)             # <<<<<<<<<<<<<<
 *                 except TypeError as e:
 *                     raise ValueError(
*/
            __pyx_t_5 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 132, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "asyncpg/protocol/codecs/array.pyx":131
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
          }
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":133
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element at index {}: {}'.format(
*/
          __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
          if (__pyx_t_15) {
            __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(2, 133, __pyx_L10_except_error)
            __Pyx_XGOTREF(__pyx_t_5);
            __Pyx_XGOTREF(__pyx_t_4);
            __Pyx_XGOTREF(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_4);
            __pyx_v_e = __pyx_t_4;
            /*try:*/ {

              /* "asyncpg/protocol/codecs/array.pyx":134
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'invalid array element at index {}: {}'.format(
 *                             i, e.args[0])) from None
*/
              __pyx_t_16 = NULL;

              /* "asyncpg/protocol/codecs/array.pyx":135
 *                 except TypeError as e:
 *                     raise ValueError(
 *                         'invalid array element at index {}: {}'.format(             # <<<<<<<<<<<<<<
 *                             i, e.args[0])) from None
 * 
*/
              __pyx_t_18 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element_at_index;
              __Pyx_INCREF(__pyx_t_18);

              /* "asyncpg/protocol/codecs/array.pyx":136
 *                     raise ValueError(
 *                         'invalid array element at index {}: {}'.format(
 *                             i, e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(12 + 8 * ndims + elem_data.len())
*/
              __pyx_t_19 = __Pyx_PyLong_From_int32_t(__pyx_v_i); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 136, __pyx_L21_error)
              __Pyx_GOTREF(__pyx_t_19);
              __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_20)) __PYX_ERR(2, 136, __pyx_L21_error)
              __Pyx_GOTREF(__pyx_t_20);
              __pyx_t_21 = __Pyx_GetItemInt(__pyx_t_20, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_21)) __PYX_ERR(2, 136, __pyx_L21_error)
              __Pyx_GOTREF(__pyx_t_21);
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              __pyx_t_8 = 0;
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_18, __pyx_t_19, __pyx_t_21};
                __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 135, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_17);
              }
              __pyx_t_8 = 1;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_17};
                __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 134, __pyx_L21_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              __Pyx_Raise(__pyx_t_6, 0, 0, Py_None);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __PYX_ERR(2, 134, __pyx_L21_error)
            }

            /* "asyncpg/protocol/codecs/array.pyx":133
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element at index {}: {}'.format(
*/
            /*finally:*/ {
              __pyx_L21_error:;
              /*exception exit:*/{
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
                __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                 __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
                if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
                __Pyx_XGOTREF(__pyx_t_24);
                __Pyx_XGOTREF(__pyx_t_25);
                __Pyx_XGOTREF(__pyx_t_26);
                __Pyx_XGOTREF(__pyx_t_27);
                __Pyx_XGOTREF(__pyx_t_28);
                __Pyx_XGOTREF(__pyx_t_29);
                __pyx_t_15 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
                {
                  __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
                }
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_XGIVEREF(__pyx_t_28);
                __Pyx_XGIVEREF(__pyx_t_29);
                __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
                __Pyx_XGIVEREF(__pyx_t_24);
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
                __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_23;
                goto __pyx_L10_except_error;
              }
            }
          }
          goto __pyx_L10_except_error;

          /* "asyncpg/protocol/codecs/array.pyx":131
 *                 elem_data.write_int32(-1)
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
          __pyx_L10_except_error:;
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          goto __pyx_L1_error;
          __pyx_L15_try_end:;
        }
      }
      __pyx_L7:;

      /* "asyncpg/protocol/codecs/array.pyx":127
 *                           encoder, encoder_arg)
 *     else:
 *         for i, item in enumerate(obj):             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "asyncpg/protocol/codecs/array.pyx":138
 *                             i, e.args[0])) from None
 * 
 *     buf.write_int32(12 + 8 * ndims + elem_data.len())             # <<<<<<<<<<<<<<
 *     # Number of dimensions
 *     buf.write_int32(ndims)
*/
  __pyx_t_1 = __Pyx_PyLong_From_long((12 + (8 * __pyx_v_ndims))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":140
 *     buf.write_int32(12 + 8 * ndims + elem_data.len())
 *     # Number of dimensions
 *     buf.write_int32(ndims)             # <<<<<<<<<<<<<<
 *     # flags
 *     buf.write_int32(0)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":142
 *     buf.write_int32(ndims)
 *     # flags
 *     buf.write_int32(0)             # <<<<<<<<<<<<<<
 *     # element type
 *     buf.write_int32(<int32_t>elem_oid)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":144
 *     buf.write_int32(0)
 *     # element type
 *     buf.write_int32(<int32_t>elem_oid)             # <<<<<<<<<<<<<<
 *     # upper / lower bounds
 *     for i in range(ndims):
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_elem_oid)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":146
 *     buf.write_int32(<int32_t>elem_oid)
 *     # upper / lower bounds
 *     for i in range(ndims):             # <<<<<<<<<<<<<<
 *         buf.write_int32(dims[i])
 *         buf.write_int32(1)
*/
  __pyx_t_9 = __pyx_v_ndims;
  __pyx_t_30 = __pyx_t_9;
  for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
    __pyx_v_i = __pyx_t_31;

    /* "asyncpg/protocol/codecs/array.pyx":147
 *     # upper / lower bounds
 *     for i in range(ndims):
 *         buf.write_int32(dims[i])             # <<<<<<<<<<<<<<
 *         buf.write_int32(1)
 *     # element data
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":148
 *     for i in range(ndims):
 *         buf.write_int32(dims[i])
 *         buf.write_int32(1)             # <<<<<<<<<<<<<<
 *     # element data
 *     buf.write_buffer(elem_data)
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "asyncpg/protocol/codecs/array.pyx":150
 *         buf.write_int32(1)
 *     # element data
 *     buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":105
 * 
 * 
 * cdef inline array_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                          object obj, uint32_t elem_oid,
 *                          encode_func_ex encoder, const void *encoder_arg):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.array_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":153
 * 
 * 
 * cdef _write_textarray_data(ConnectionSettings settings, object obj,             # <<<<<<<<<<<<<<
 *                            int32_t ndims, int32_t dim, WriteBuffer array_data,
 *                            encode_func_ex encoder, const void *encoder_arg,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, PyObject *__pyx_v_obj, int32_t __pyx_v_ndims, int32_t __pyx_v_dim, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_array_data, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg, Py_UCS4 __pyx_v_typdelim) {
  Py_ssize_t __pyx_v_i;
  int8_t __pyx_v_delim;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_buffer __pyx_v_pybuf;
  char const *__pyx_v_elem_str;
  char __pyx_v_ch;
  Py_ssize_t __pyx_v_elem_len;
  Py_ssize_t __pyx_v_quoted_elem_len;
  int __pyx_v_need_quoting;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  size_t __pyx_t_18;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  int __pyx_t_30;
  char const *__pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_textarray_data", 0);

  /* "asyncpg/protocol/codecs/array.pyx":158
 *                            Py_UCS4 typdelim):
 *     cdef:
 *         ssize_t i = 0             # <<<<<<<<<<<<<<
 *         int8_t delim = <int8_t>typdelim
 *         WriteBuffer elem_data
*/
  __pyx_v_i = 0;

  /* "asyncpg/protocol/codecs/array.pyx":159
 *     cdef:
 *         ssize_t i = 0
 *         int8_t delim = <int8_t>typdelim             # <<<<<<<<<<<<<<
 *         WriteBuffer elem_data
 *         Py_buffer pybuf
*/
  __pyx_v_delim = ((int8_t)__pyx_v_typdelim);

  /* "asyncpg/protocol/codecs/array.pyx":168
 *         bint need_quoting
 * 
 *     array_data.write_byte(b'{')             # <<<<<<<<<<<<<<
 * 
 *     if dim < ndims - 1:
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '{'); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":170
 *     array_data.write_byte(b'{')
 * 
 *     if dim < ndims - 1:             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             if i > 0:
*/
    __pyx_t_2 = (__pyx_v_dim < (__pyx_v_ndims - 1));
    if (__pyx_t_2) {

      /* "asyncpg/protocol/codecs/array.pyx":171
 * 
 *     if dim < ndims - 1:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             if i > 0:
 *                 array_data.write_byte(delim)
*/
      if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
        __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        __pyx_t_4 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 171, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_4)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 171, __pyx_L1_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_3;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 171, __pyx_L1_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
            #endif
            ++__pyx_t_3;
          }
          if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 171, __pyx_L1_error)
        } else {
          __pyx_t_5 = __pyx_t_4(__pyx_t_1);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 171, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":172
 *     if dim < ndims - 1:
 *         for item in obj:
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')
*/
        __pyx_t_2 = (__pyx_v_i > 0);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":173
 *         for item in obj:
 *             if i > 0:
 *                 array_data.write_byte(delim)             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(b' ')
 *             _write_textarray_data(settings, item, ndims, dim + 1, array_data,
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 173, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":174
 *             if i > 0:
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')             # <<<<<<<<<<<<<<
 *             _write_textarray_data(settings, item, ndims, dim + 1, array_data,
 *                                   encoder, encoder_arg, typdelim)
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":172
 *     if dim < ndims - 1:
 *         for item in obj:
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":175
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')
 *             _write_textarray_data(settings, item, ndims, dim + 1, array_data,             # <<<<<<<<<<<<<<
 *                                   encoder, encoder_arg, typdelim)
 *             i += 1
*/
        __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(__pyx_v_settings, __pyx_v_item, __pyx_v_ndims, (__pyx_v_dim + 1), __pyx_v_array_data, __pyx_v_encoder, __pyx_v_encoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":177
 *             _write_textarray_data(settings, item, ndims, dim + 1, array_data,
 *                                   encoder, encoder_arg, typdelim)
 *             i += 1             # <<<<<<<<<<<<<<
 *     else:
 *         for item in obj:
*/
        __pyx_v_i = (__pyx_v_i + 1);

        /* "asyncpg/protocol/codecs/array.pyx":171
 * 
 *     if dim < ndims - 1:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             if i > 0:
 *                 array_data.write_byte(delim)
*/
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":170
 *     array_data.write_byte(b'{')
 * 
 *     if dim < ndims - 1:             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             if i > 0:
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/codecs/array.pyx":179
 *             i += 1
 *     else:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             elem_data = WriteBuffer.new()
 * 
*/
    /*else*/ {
      if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
        __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        __pyx_t_4 = NULL;
      } else {
        __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 179, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_4)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 179, __pyx_L1_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_3;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 179, __pyx_L1_error)
              #endif
              if (__pyx_t_3 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
            #endif
            ++__pyx_t_3;
          }
          if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 179, __pyx_L1_error)
        } else {
          __pyx_t_5 = __pyx_t_4(__pyx_t_1);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(2, 179, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":180
 *     else:
 *         for item in obj:
 *             elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *             if i > 0:
*/
        __pyx_t_5 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_elem_data, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5));
        __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":182
 *             elem_data = WriteBuffer.new()
 * 
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')
*/
        __pyx_t_2 = (__pyx_v_i > 0);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":183
 * 
 *             if i > 0:
 *                 array_data.write_byte(delim)             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(b' ')
 * 
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_delim); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 183, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":184
 *             if i > 0:
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')             # <<<<<<<<<<<<<<
 * 
 *             if item is None:
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, ' '); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 184, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":182
 *             elem_data = WriteBuffer.new()
 * 
 *             if i > 0:             # <<<<<<<<<<<<<<
 *                 array_data.write_byte(delim)
 *                 array_data.write_byte(b' ')
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":186
 *                 array_data.write_byte(b' ')
 * 
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 array_data.write_bytes(b'NULL')
 *                 i += 1
*/
        __pyx_t_2 = (__pyx_v_item == Py_None);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":187
 * 
 *             if item is None:
 *                 array_data.write_bytes(b'NULL')             # <<<<<<<<<<<<<<
 *                 i += 1
 *                 continue
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_bytes(__pyx_v_array_data, __pyx_mstate_global->__pyx_n_b_NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":188
 *             if item is None:
 *                 array_data.write_bytes(b'NULL')
 *                 i += 1             # <<<<<<<<<<<<<<
 *                 continue
 *             else:
*/
          __pyx_v_i = (__pyx_v_i + 1);

          /* "asyncpg/protocol/codecs/array.pyx":189
 *                 array_data.write_bytes(b'NULL')
 *                 i += 1
 *                 continue             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
*/
          goto __pyx_L8_continue;

          /* "asyncpg/protocol/codecs/array.pyx":186
 *                 array_data.write_byte(b' ')
 * 
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 array_data.write_bytes(b'NULL')
 *                 i += 1
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":191
 *                 continue
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
        /*else*/ {
          {
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_6);
            __Pyx_XGOTREF(__pyx_t_7);
            __Pyx_XGOTREF(__pyx_t_8);
            /*try:*/ {

              /* "asyncpg/protocol/codecs/array.pyx":192
 *             else:
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)             # <<<<<<<<<<<<<<
 *                 except TypeError as e:
 *                     raise ValueError(
*/
              __pyx_t_5 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_item, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 192, __pyx_L12_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

              /* "asyncpg/protocol/codecs/array.pyx":191
 *                 continue
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
            }
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L19_try_end;
            __pyx_L12_error:;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "asyncpg/protocol/codecs/array.pyx":193
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
*/
            __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
            if (__pyx_t_9) {
              __Pyx_AddTraceback("asyncpg.protocol.protocol._write_textarray_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(2, 193, __pyx_L14_except_error)
              __Pyx_XGOTREF(__pyx_t_5);
              __Pyx_XGOTREF(__pyx_t_10);
              __Pyx_XGOTREF(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_10);
              __pyx_v_e = __pyx_t_10;
              /*try:*/ {

                /* "asyncpg/protocol/codecs/array.pyx":194
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'invalid array element: {}'.format(
 *                             e.args[0])) from None
*/
                __pyx_t_13 = NULL;

                /* "asyncpg/protocol/codecs/array.pyx":195
 *                 except TypeError as e:
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(             # <<<<<<<<<<<<<<
 *                             e.args[0])) from None
 * 
*/
                __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_invalid_array_element;
                __Pyx_INCREF(__pyx_t_15);

                /* "asyncpg/protocol/codecs/array.pyx":196
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
 *                             e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *             # element string length (first four bytes are the encoded length.)
*/
                __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 196, __pyx_L25_error)
                __Pyx_GOTREF(__pyx_t_16);
                __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(2, 196, __pyx_L25_error)
                __Pyx_GOTREF(__pyx_t_17);
                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                __pyx_t_18 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17};
                  __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 195, __pyx_L25_error)
                  __Pyx_GOTREF(__pyx_t_14);
                }
                __pyx_t_18 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
                  __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_18, (2-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 194, __pyx_L25_error)
                  __Pyx_GOTREF(__pyx_t_12);
                }
                __Pyx_Raise(__pyx_t_12, 0, 0, Py_None);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __PYX_ERR(2, 194, __pyx_L25_error)
              }

              /* "asyncpg/protocol/codecs/array.pyx":193
 *                 try:
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
*/
              /*finally:*/ {
                __pyx_L25_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_declare
                  __Pyx_PyThreadState_assign
                  __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                   __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
                  if ( unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
                  __Pyx_XGOTREF(__pyx_t_21);
                  __Pyx_XGOTREF(__pyx_t_22);
                  __Pyx_XGOTREF(__pyx_t_23);
                  __Pyx_XGOTREF(__pyx_t_24);
                  __Pyx_XGOTREF(__pyx_t_25);
                  __Pyx_XGOTREF(__pyx_t_26);
                  __pyx_t_9 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
                  {
                    __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
                  }
                  __Pyx_XGIVEREF(__pyx_t_24);
                  __Pyx_XGIVEREF(__pyx_t_25);
                  __Pyx_XGIVEREF(__pyx_t_26);
                  __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_XGIVEREF(__pyx_t_22);
                  __Pyx_XGIVEREF(__pyx_t_23);
                  __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
                  __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                  __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
                  goto __pyx_L14_except_error;
                }
              }
            }
            goto __pyx_L14_except_error;

            /* "asyncpg/protocol/codecs/array.pyx":191
 *                 continue
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     encoder(settings, elem_data, item, encoder_arg)
 *                 except TypeError as e:
*/
            __pyx_L14_except_error:;
            __Pyx_XGIVEREF(__pyx_t_6);
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
            goto __pyx_L1_error;
            __pyx_L19_try_end:;
          }
        }

        /* "asyncpg/protocol/codecs/array.pyx":199
 * 
 *             # element string length (first four bytes are the encoded length.)
 *             elem_len = elem_data.len() - 4             # <<<<<<<<<<<<<<
 * 
 *             if elem_len == 0:
*/
        __pyx_t_11 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = __Pyx_PyLong_SubtractObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_27 = PyLong_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 199, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_elem_len = __pyx_t_27;

        /* "asyncpg/protocol/codecs/array.pyx":201
 *             elem_len = elem_data.len() - 4
 * 
 *             if elem_len == 0:             # <<<<<<<<<<<<<<
 *                 # Empty string
 *                 array_data.write_bytes(b'""')
*/
        __pyx_t_2 = (__pyx_v_elem_len == 0);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":203
 *             if elem_len == 0:
 *                 # Empty string
 *                 array_data.write_bytes(b'""')             # <<<<<<<<<<<<<<
 *             else:
 *                 cpython.PyObject_GetBuffer(
*/
          __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_bytes(__pyx_v_array_data, __pyx_mstate_global->__pyx_kp_b__10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 203, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":201
 *             elem_len = elem_data.len() - 4
 * 
 *             if elem_len == 0:             # <<<<<<<<<<<<<<
 *                 # Empty string
 *                 array_data.write_bytes(b'""')
*/
          goto __pyx_L31;
        }

        /* "asyncpg/protocol/codecs/array.pyx":205
 *                 array_data.write_bytes(b'""')
 *             else:
 *                 cpython.PyObject_GetBuffer(             # <<<<<<<<<<<<<<
 *                     elem_data, &pybuf, cpython.PyBUF_SIMPLE)
 * 
*/
        /*else*/ {

          /* "asyncpg/protocol/codecs/array.pyx":206
 *             else:
 *                 cpython.PyObject_GetBuffer(
 *                     elem_data, &pybuf, cpython.PyBUF_SIMPLE)             # <<<<<<<<<<<<<<
 * 
 *                 elem_str = <const char*>(pybuf.buf) + 4
*/
          __pyx_t_19 = PyObject_GetBuffer(((PyObject *)__pyx_v_elem_data), (&__pyx_v_pybuf), PyBUF_SIMPLE); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(2, 205, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":208
 *                     elem_data, &pybuf, cpython.PyBUF_SIMPLE)
 * 
 *                 elem_str = <const char*>(pybuf.buf) + 4             # <<<<<<<<<<<<<<
 * 
 *                 try:
*/
          __pyx_v_elem_str = (((char const *)__pyx_v_pybuf.buf) + 4);

          /* "asyncpg/protocol/codecs/array.pyx":210
 *                 elem_str = <const char*>(pybuf.buf) + 4
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     if not apg_strcasecmp_char(elem_str, b'NULL'):
 *                         array_data.write_byte(b'"')
*/
          /*try:*/ {

            /* "asyncpg/protocol/codecs/array.pyx":211
 * 
 *                 try:
 *                     if not apg_strcasecmp_char(elem_str, b'NULL'):             # <<<<<<<<<<<<<<
 *                         array_data.write_byte(b'"')
 *                         array_data.write_cstr(elem_str, 4)
*/
            __pyx_t_19 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp_char(__pyx_v_elem_str, __pyx_k_NULL); if (unlikely(__pyx_t_19 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 211, __pyx_L35_error)
            __pyx_t_2 = (!(__pyx_t_19 != 0));
            if (__pyx_t_2) {

              /* "asyncpg/protocol/codecs/array.pyx":212
 *                 try:
 *                     if not apg_strcasecmp_char(elem_str, b'NULL'):
 *                         array_data.write_byte(b'"')             # <<<<<<<<<<<<<<
 *                         array_data.write_cstr(elem_str, 4)
 *                         array_data.write_byte(b'"')
*/
              __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 212, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "asyncpg/protocol/codecs/array.pyx":213
 *                     if not apg_strcasecmp_char(elem_str, b'NULL'):
 *                         array_data.write_byte(b'"')
 *                         array_data.write_cstr(elem_str, 4)             # <<<<<<<<<<<<<<
 *                         array_data.write_byte(b'"')
 *                     else:
*/
              __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, 4); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 213, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "asyncpg/protocol/codecs/array.pyx":214
 *                         array_data.write_byte(b'"')
 *                         array_data.write_cstr(elem_str, 4)
 *                         array_data.write_byte(b'"')             # <<<<<<<<<<<<<<
 *                     else:
 *                         quoted_elem_len = elem_len
*/
              __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 214, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "asyncpg/protocol/codecs/array.pyx":211
 * 
 *                 try:
 *                     if not apg_strcasecmp_char(elem_str, b'NULL'):             # <<<<<<<<<<<<<<
 *                         array_data.write_byte(b'"')
 *                         array_data.write_cstr(elem_str, 4)
*/
              goto __pyx_L37;
            }

            /* "asyncpg/protocol/codecs/array.pyx":216
 *                         array_data.write_byte(b'"')
 *                     else:
 *                         quoted_elem_len = elem_len             # <<<<<<<<<<<<<<
 *                         need_quoting = False
 * 
*/
            /*else*/ {
              __pyx_v_quoted_elem_len = __pyx_v_elem_len;

              /* "asyncpg/protocol/codecs/array.pyx":217
 *                     else:
 *                         quoted_elem_len = elem_len
 *                         need_quoting = False             # <<<<<<<<<<<<<<
 * 
 *                         for i in range(elem_len):
*/
              __pyx_v_need_quoting = 0;

              /* "asyncpg/protocol/codecs/array.pyx":219
 *                         need_quoting = False
 * 
 *                         for i in range(elem_len):             # <<<<<<<<<<<<<<
 *                             ch = elem_str[i]
 *                             if ch == b'"' or ch == b'\\':
*/
              __pyx_t_27 = __pyx_v_elem_len;
              __pyx_t_28 = __pyx_t_27;
              for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
                __pyx_v_i = __pyx_t_29;

                /* "asyncpg/protocol/codecs/array.pyx":220
 * 
 *                         for i in range(elem_len):
 *                             ch = elem_str[i]             # <<<<<<<<<<<<<<
 *                             if ch == b'"' or ch == b'\\':
 *                                 # Quotes and backslashes need escaping.
*/
                __pyx_v_ch = (__pyx_v_elem_str[__pyx_v_i]);

                /* "asyncpg/protocol/codecs/array.pyx":221
 *                         for i in range(elem_len):
 *                             ch = elem_str[i]
 *                             if ch == b'"' or ch == b'\\':             # <<<<<<<<<<<<<<
 *                                 # Quotes and backslashes need escaping.
 *                                 quoted_elem_len += 1
*/
                switch (__pyx_v_ch) {
                  case '"':
                  case '\\':
                  __pyx_t_2 = 1;
                  break;
                  default:
                  __pyx_t_2 = 0;
                  break;
                }
                if (__pyx_t_2) {

                  /* "asyncpg/protocol/codecs/array.pyx":223
 *                             if ch == b'"' or ch == b'\\':
 *                                 # Quotes and backslashes need escaping.
 *                                 quoted_elem_len += 1             # <<<<<<<<<<<<<<
 *                                 need_quoting = True
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or
*/
                  __pyx_v_quoted_elem_len = (__pyx_v_quoted_elem_len + 1);

                  /* "asyncpg/protocol/codecs/array.pyx":224
 *                                 # Quotes and backslashes need escaping.
 *                                 quoted_elem_len += 1
 *                                 need_quoting = True             # <<<<<<<<<<<<<<
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or
 *                                     apg_ascii_isspace(<uint32_t>ch)):
*/
                  __pyx_v_need_quoting = 1;

                  /* "asyncpg/protocol/codecs/array.pyx":221
 *                         for i in range(elem_len):
 *                             ch = elem_str[i]
 *                             if ch == b'"' or ch == b'\\':             # <<<<<<<<<<<<<<
 *                                 # Quotes and backslashes need escaping.
 *                                 quoted_elem_len += 1
*/
                  goto __pyx_L40;
                }

                /* "asyncpg/protocol/codecs/array.pyx":225
 *                                 quoted_elem_len += 1
 *                                 need_quoting = True
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or             # <<<<<<<<<<<<<<
 *                                     apg_ascii_isspace(<uint32_t>ch)):
 *                                 need_quoting = True
*/
                __pyx_t_30 = (__pyx_v_ch == '{');
                  if (!__pyx_t_30) {
                  } else {
                    __pyx_t_2 = __pyx_t_30;
                    goto __pyx_L41_bool_binop_done;
                  }
                __pyx_t_30 = (__pyx_v_ch == '}');
                if (!__pyx_t_30) {
                } else {
                  __pyx_t_2 = __pyx_t_30;
                  goto __pyx_L41_bool_binop_done;
                }
                __pyx_t_30 = (__pyx_v_ch == __pyx_v_delim);
                if (!__pyx_t_30) {
                } else {
                  __pyx_t_2 = __pyx_t_30;
                  goto __pyx_L41_bool_binop_done;
                }

                /* "asyncpg/protocol/codecs/array.pyx":226
 *                                 need_quoting = True
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or
 *                                     apg_ascii_isspace(<uint32_t>ch)):             # <<<<<<<<<<<<<<
 *                                 need_quoting = True
 * 
*/
                __pyx_t_30 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace(((uint32_t)__pyx_v_ch)); if (unlikely(__pyx_t_30 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 226, __pyx_L35_error)
                __pyx_t_2 = __pyx_t_30;
                __pyx_L41_bool_binop_done:;

                /* "asyncpg/protocol/codecs/array.pyx":225
 *                                 quoted_elem_len += 1
 *                                 need_quoting = True
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or             # <<<<<<<<<<<<<<
 *                                     apg_ascii_isspace(<uint32_t>ch)):
 *                                 need_quoting = True
*/
                if (__pyx_t_2) {

                  /* "asyncpg/protocol/codecs/array.pyx":227
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or
 *                                     apg_ascii_isspace(<uint32_t>ch)):
 *                                 need_quoting = True             # <<<<<<<<<<<<<<
 * 
 *                         if need_quoting:
*/
                  __pyx_v_need_quoting = 1;

                  /* "asyncpg/protocol/codecs/array.pyx":225
 *                                 quoted_elem_len += 1
 *                                 need_quoting = True
 *                             elif (ch == b'{' or ch == b'}' or ch == delim or             # <<<<<<<<<<<<<<
 *                                     apg_ascii_isspace(<uint32_t>ch)):
 *                                 need_quoting = True
*/
                }
                __pyx_L40:;
              }

              /* "asyncpg/protocol/codecs/array.pyx":229
 *                                 need_quoting = True
 * 
 *                         if need_quoting:             # <<<<<<<<<<<<<<
 *                             array_data.write_byte(b'"')
 * 
*/
              if (__pyx_v_need_quoting) {

                /* "asyncpg/protocol/codecs/array.pyx":230
 * 
 *                         if need_quoting:
 *                             array_data.write_byte(b'"')             # <<<<<<<<<<<<<<
 * 
 *                             if quoted_elem_len == elem_len:
*/
                __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 230, __pyx_L35_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

                /* "asyncpg/protocol/codecs/array.pyx":232
 *                             array_data.write_byte(b'"')
 * 
 *                             if quoted_elem_len == elem_len:             # <<<<<<<<<<<<<<
 *                                 array_data.write_cstr(elem_str, elem_len)
 *                             else:
*/
                __pyx_t_2 = (__pyx_v_quoted_elem_len == __pyx_v_elem_len);
                if (__pyx_t_2) {

                  /* "asyncpg/protocol/codecs/array.pyx":233
 * 
 *                             if quoted_elem_len == elem_len:
 *                                 array_data.write_cstr(elem_str, elem_len)             # <<<<<<<<<<<<<<
 *                             else:
 *                                 # Escaping required.
*/
                  __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 233, __pyx_L35_error)
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

                  /* "asyncpg/protocol/codecs/array.pyx":232
 *                             array_data.write_byte(b'"')
 * 
 *                             if quoted_elem_len == elem_len:             # <<<<<<<<<<<<<<
 *                                 array_data.write_cstr(elem_str, elem_len)
 *                             else:
*/
                  goto __pyx_L46;
                }

                /* "asyncpg/protocol/codecs/array.pyx":236
 *                             else:
 *                                 # Escaping required.
 *                                 for i in range(elem_len):             # <<<<<<<<<<<<<<
 *                                     ch = elem_str[i]
 *                                     if ch == b'"' or ch == b'\\':
*/
                /*else*/ {
                  __pyx_t_27 = __pyx_v_elem_len;
                  __pyx_t_28 = __pyx_t_27;
                  for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
                    __pyx_v_i = __pyx_t_29;

                    /* "asyncpg/protocol/codecs/array.pyx":237
 *                                 # Escaping required.
 *                                 for i in range(elem_len):
 *                                     ch = elem_str[i]             # <<<<<<<<<<<<<<
 *                                     if ch == b'"' or ch == b'\\':
 *                                         array_data.write_byte(b'\\')
*/
                    __pyx_v_ch = (__pyx_v_elem_str[__pyx_v_i]);

                    /* "asyncpg/protocol/codecs/array.pyx":238
 *                                 for i in range(elem_len):
 *                                     ch = elem_str[i]
 *                                     if ch == b'"' or ch == b'\\':             # <<<<<<<<<<<<<<
 *                                         array_data.write_byte(b'\\')
 *                                     array_data.write_byte(ch)
*/
                    switch (__pyx_v_ch) {
                      case '"':
                      case '\\':

                      /* "asyncpg/protocol/codecs/array.pyx":239
 *                                     ch = elem_str[i]
 *                                     if ch == b'"' or ch == b'\\':
 *                                         array_data.write_byte(b'\\')             # <<<<<<<<<<<<<<
 *                                     array_data.write_byte(ch)
 * 
*/
                      __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '\\'); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 239, __pyx_L35_error)
                      __Pyx_GOTREF(__pyx_t_10);
                      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

                      /* "asyncpg/protocol/codecs/array.pyx":238
 *                                 for i in range(elem_len):
 *                                     ch = elem_str[i]
 *                                     if ch == b'"' or ch == b'\\':             # <<<<<<<<<<<<<<
 *                                         array_data.write_byte(b'\\')
 *                                     array_data.write_byte(ch)
*/
                      break;
                      default: break;
                    }

                    /* "asyncpg/protocol/codecs/array.pyx":240
 *                                     if ch == b'"' or ch == b'\\':
 *                                         array_data.write_byte(b'\\')
 *                                     array_data.write_byte(ch)             # <<<<<<<<<<<<<<
 * 
 *                             array_data.write_byte(b'"')
*/
                    __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, __pyx_v_ch); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 240, __pyx_L35_error)
                    __Pyx_GOTREF(__pyx_t_10);
                    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  }
                }
                __pyx_L46:;

                /* "asyncpg/protocol/codecs/array.pyx":242
 *                                     array_data.write_byte(ch)
 * 
 *                             array_data.write_byte(b'"')             # <<<<<<<<<<<<<<
 *                         else:
 *                             array_data.write_cstr(elem_str, elem_len)
*/
                __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '"'); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 242, __pyx_L35_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

                /* "asyncpg/protocol/codecs/array.pyx":229
 *                                 need_quoting = True
 * 
 *                         if need_quoting:             # <<<<<<<<<<<<<<
 *                             array_data.write_byte(b'"')
 * 
*/
                goto __pyx_L45;
              }

              /* "asyncpg/protocol/codecs/array.pyx":244
 *                             array_data.write_byte(b'"')
 *                         else:
 *                             array_data.write_cstr(elem_str, elem_len)             # <<<<<<<<<<<<<<
 *                 finally:
 *                     cpython.PyBuffer_Release(&pybuf)
*/
              /*else*/ {
                __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_cstr(__pyx_v_array_data, __pyx_v_elem_str, __pyx_v_elem_len); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 244, __pyx_L35_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              }
              __pyx_L45:;
            }
            __pyx_L37:;
          }

          /* "asyncpg/protocol/codecs/array.pyx":246
 *                             array_data.write_cstr(elem_str, elem_len)
 *                 finally:
 *                     cpython.PyBuffer_Release(&pybuf)             # <<<<<<<<<<<<<<
 * 
 *             i += 1
*/
          /*finally:*/ {
            /*normal exit:*/{
              PyBuffer_Release((&__pyx_v_pybuf));
              goto __pyx_L36;
            }
            __pyx_L35_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
              if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
              __Pyx_XGOTREF(__pyx_t_8);
              __Pyx_XGOTREF(__pyx_t_7);
              __Pyx_XGOTREF(__pyx_t_6);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_24);
              __pyx_t_19 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_31 = __pyx_filename;
              {
                PyBuffer_Release((&__pyx_v_pybuf));
              }
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_8);
              __Pyx_XGIVEREF(__pyx_t_7);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
              __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
              __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_31;
              goto __pyx_L1_error;
            }
            __pyx_L36:;
          }
        }
        __pyx_L31:;

        /* "asyncpg/protocol/codecs/array.pyx":248
 *                     cpython.PyBuffer_Release(&pybuf)
 * 
 *             i += 1             # <<<<<<<<<<<<<<
 * 
 *     array_data.write_byte(b'}')
*/
        __pyx_v_i = (__pyx_v_i + 1);

        /* "asyncpg/protocol/codecs/array.pyx":179
 *             i += 1
 *     else:
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             elem_data = WriteBuffer.new()
 * 
*/
        __pyx_L8_continue:;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L3:;

    /* "asyncpg/protocol/codecs/array.pyx":250
 *             i += 1
 * 
 *     array_data.write_byte(b'}')             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_array_data->__pyx_vtab)->write_byte(__pyx_v_array_data, '}'); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":153
 * 
 * 
 * cdef _write_textarray_data(ConnectionSettings settings, object obj,             # <<<<<<<<<<<<<<
 *                            int32_t ndims, int32_t dim, WriteBuffer array_data,
 *                            encode_func_ex encoder, const void *encoder_arg,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._write_textarray_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":253
 * 
 * 
 * cdef inline textarray_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                              object obj, encode_func_ex encoder,
 *                              const void *encoder_arg, Py_UCS4 typdelim):
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg, Py_UCS4 __pyx_v_typdelim) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_array_data = 0;
  int32_t __pyx_v_dims[6];
  int32_t __pyx_v_ndims;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int32_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("textarray_encode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":259
 *         WriteBuffer array_data
 *         int32_t dims[ARRAY_MAXDIM]
 *         int32_t ndims = 1             # <<<<<<<<<<<<<<
 *         int32_t i
 * 
*/
  __pyx_v_ndims = 1;

  /* "asyncpg/protocol/codecs/array.pyx":262
 *         int32_t i
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/codecs/array.pyx":263
 * 
 *     if not _is_array_iterable(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))
*/
    __pyx_t_4 = NULL;

    /* "asyncpg/protocol/codecs/array.pyx":264
 *     if not _is_array_iterable(obj):
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj).__name__))
 * 
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec;
    __Pyx_INCREF(__pyx_t_6);

    /* "asyncpg/protocol/codecs/array.pyx":265
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *     _get_array_shape(obj, dims, &ndims)
*/
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 263, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":262
 *         int32_t i
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":267
 *                 type(obj).__name__))
 * 
 *     _get_array_shape(obj, dims, &ndims)             # <<<<<<<<<<<<<<
 * 
 *     array_data = WriteBuffer.new()
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__get_array_shape(__pyx_v_obj, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":269
 *     _get_array_shape(obj, dims, &ndims)
 * 
 *     array_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *     _write_textarray_data(settings, obj, ndims, 0, array_data,
 *                           encoder, encoder_arg, typdelim)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_array_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":270
 * 
 *     array_data = WriteBuffer.new()
 *     _write_textarray_data(settings, obj, ndims, 0, array_data,             # <<<<<<<<<<<<<<
 *                           encoder, encoder_arg, typdelim)
 *     buf.write_int32(array_data.len())
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__write_textarray_data(__pyx_v_settings, __pyx_v_obj, __pyx_v_ndims, 0, __pyx_v_array_data, __pyx_v_encoder, __pyx_v_encoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":272
 *     _write_textarray_data(settings, obj, ndims, 0, array_data,
 *                           encoder, encoder_arg, typdelim)
 *     buf.write_int32(array_data.len())             # <<<<<<<<<<<<<<
 *     buf.write_buffer(array_data)
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_array_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":273
 *                           encoder, encoder_arg, typdelim)
 *     buf.write_int32(array_data.len())
 *     buf.write_buffer(array_data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_array_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":253
 * 
 * 
 * cdef inline textarray_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                              object obj, encode_func_ex encoder,
 *                              const void *encoder_arg, Py_UCS4 typdelim):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":276
 * 
 * 
 * cdef inline array_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                          decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) {
  int32_t __pyx_v_ndims;
  CYTHON_UNUSED int32_t __pyx_v_flags;
  CYTHON_UNUSED uint32_t __pyx_v_elem_oid;
  PyObject *__pyx_v_result = 0;
  int __pyx_v_i;
  int32_t __pyx_v_elem_len;
  int32_t __pyx_v_elem_count;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  int32_t __pyx_v_dims[6];
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int32_t __pyx_t_10;
  int32_t __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":279
 *                          decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
 *         int32_t ndims = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         int32_t flags = hton.unpack_int32(frb_read(buf, 4))
 *         uint32_t elem_oid = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 279, __pyx_L1_error)
  __pyx_v_ndims = unpack_int32(__pyx_t_1);

  /* "asyncpg/protocol/codecs/array.pyx":280
 *     cdef:
 *         int32_t ndims = hton.unpack_int32(frb_read(buf, 4))
 *         int32_t flags = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         uint32_t elem_oid = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         list result
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 280, __pyx_L1_error)
  __pyx_v_flags = unpack_int32(__pyx_t_1);

  /* "asyncpg/protocol/codecs/array.pyx":281
 *         int32_t ndims = hton.unpack_int32(frb_read(buf, 4))
 *         int32_t flags = hton.unpack_int32(frb_read(buf, 4))
 *         uint32_t elem_oid = <uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         list result
 *         int i
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 281, __pyx_L1_error)
  __pyx_v_elem_oid = ((uint32_t)unpack_int32(__pyx_t_1));

  /* "asyncpg/protocol/codecs/array.pyx":285
 *         int i
 *         int32_t elem_len
 *         int32_t elem_count = 1             # <<<<<<<<<<<<<<
 *         FRBuffer elem_buf
 *         int32_t dims[ARRAY_MAXDIM]
*/
  __pyx_v_elem_count = 1;

  /* "asyncpg/protocol/codecs/array.pyx":290
 *         Codec elem_codec
 * 
 *     if ndims == 0:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  __pyx_t_2 = (__pyx_v_ndims == 0);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/array.pyx":291
 * 
 *     if ndims == 0:
 *         return []             # <<<<<<<<<<<<<<
 * 
 *     if ndims > ARRAY_MAXDIM:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/array.pyx":290
 *         Codec elem_codec
 * 
 *     if ndims == 0:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":293
 *         return []
 * 
 *     if ndims > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
*/
  __pyx_t_2 = (__pyx_v_ndims > 6);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/array.pyx":294
 * 
 *     if ndims > ARRAY_MAXDIM:
 *         raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *             format(ndims, ARRAY_MAXDIM))
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":296
 *         raise exceptions.ProtocolError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *             format(ndims, ARRAY_MAXDIM))             # <<<<<<<<<<<<<<
 *     elif ndims < 0:
 *         raise exceptions.ProtocolError(
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_mstate_global->__pyx_int_6};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 294, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":293
 *         return []
 * 
 *     if ndims > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":297
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *             format(ndims, ARRAY_MAXDIM))
 *     elif ndims < 0:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'unexpected array dimensions value: {}'.format(ndims))
*/
  __pyx_t_2 = (__pyx_v_ndims < 0);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/array.pyx":298
 *             format(ndims, ARRAY_MAXDIM))
 *     elif ndims < 0:
 *         raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *             'unexpected array dimensions value: {}'.format(ndims))
 * 
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":299
 *     elif ndims < 0:
 *         raise exceptions.ProtocolError(
 *             'unexpected array dimensions value: {}'.format(ndims))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndims):
*/
    __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimensions_valu;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 299, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 298, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":297
 *             'number of array dimensions ({}) exceed the maximum expected ({})'.
 *             format(ndims, ARRAY_MAXDIM))
 *     elif ndims < 0:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'unexpected array dimensions value: {}'.format(ndims))
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":301
 *             'unexpected array dimensions value: {}'.format(ndims))
 * 
 *     for i in range(ndims):             # <<<<<<<<<<<<<<
 *         dims[i] = hton.unpack_int32(frb_read(buf, 4))
 *         if dims[i] < 0:
*/
  __pyx_t_10 = __pyx_v_ndims;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "asyncpg/protocol/codecs/array.pyx":302
 * 
 *     for i in range(ndims):
 *         dims[i] = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if dims[i] < 0:
 *             raise exceptions.ProtocolError(
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 302, __pyx_L1_error)
    (__pyx_v_dims[__pyx_v_i]) = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/array.pyx":303
 *     for i in range(ndims):
 *         dims[i] = hton.unpack_int32(frb_read(buf, 4))
 *         if dims[i] < 0:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'unexpected array dimension size: {}'.format(dims[i]))
*/
    __pyx_t_2 = ((__pyx_v_dims[__pyx_v_i]) < 0);
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/codecs/array.pyx":304
 *         dims[i] = hton.unpack_int32(frb_read(buf, 4))
 *         if dims[i] < 0:
 *             raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *                 'unexpected array dimension size: {}'.format(dims[i]))
 *         # Ignore the lower bound information
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":305
 *         if dims[i] < 0:
 *             raise exceptions.ProtocolError(
 *                 'unexpected array dimension size: {}'.format(dims[i]))             # <<<<<<<<<<<<<<
 *         # Ignore the lower bound information
 *         frb_read(buf, 4)
*/
      __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_array_dimension_size;
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyLong_From_int32_t((__pyx_v_dims[__pyx_v_i])); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 304, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":303
 *     for i in range(ndims):
 *         dims[i] = hton.unpack_int32(frb_read(buf, 4))
 *         if dims[i] < 0:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'unexpected array dimension size: {}'.format(dims[i]))
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":307
 *                 'unexpected array dimension size: {}'.format(dims[i]))
 *         # Ignore the lower bound information
 *         frb_read(buf, 4)             # <<<<<<<<<<<<<<
 * 
 *     if ndims == 1:
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 307, __pyx_L1_error)
  }

  /* "asyncpg/protocol/codecs/array.pyx":309
 *         frb_read(buf, 4)
 * 
 *     if ndims == 1:             # <<<<<<<<<<<<<<
 *         # Fast path for flat arrays
 *         elem_count = dims[0]
*/
  __pyx_t_2 = (__pyx_v_ndims == 1);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/array.pyx":311
 *     if ndims == 1:
 *         # Fast path for flat arrays
 *         elem_count = dims[0]             # <<<<<<<<<<<<<<
 *         result = cpython.PyList_New(elem_count)
 * 
*/
    __pyx_v_elem_count = (__pyx_v_dims[0]);

    /* "asyncpg/protocol/codecs/array.pyx":312
 *         # Fast path for flat arrays
 *         elem_count = dims[0]
 *         result = cpython.PyList_New(elem_count)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(elem_count):
*/
    __pyx_t_3 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_result = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":314
 *         result = cpython.PyList_New(elem_count)
 * 
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
*/
    __pyx_t_10 = __pyx_v_elem_count;
    __pyx_t_11 = __pyx_t_10;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "asyncpg/protocol/codecs/array.pyx":315
 * 
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if elem_len == -1:
 *                 elem = None
*/
      __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(2, 315, __pyx_L1_error)
      __pyx_v_elem_len = unpack_int32(__pyx_t_1);

      /* "asyncpg/protocol/codecs/array.pyx":316
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
*/
      __pyx_t_2 = (__pyx_v_elem_len == -1L);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":317
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)
*/
        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

        /* "asyncpg/protocol/codecs/array.pyx":316
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
*/
        goto __pyx_L11;
      }

      /* "asyncpg/protocol/codecs/array.pyx":319
 *                 elem = None
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)             # <<<<<<<<<<<<<<
 *                 elem = decoder(settings, &elem_buf, decoder_arg)
 * 
*/
      /*else*/ {
        __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_13 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 319, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/array.pyx":320
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = decoder(settings, &elem_buf, decoder_arg)             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
*/
        __pyx_t_3 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_elem_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L11:;

      /* "asyncpg/protocol/codecs/array.pyx":322
 *                 elem = decoder(settings, &elem_buf, decoder_arg)
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
*/
      Py_INCREF(__pyx_v_elem);

      /* "asyncpg/protocol/codecs/array.pyx":323
 * 
 *             cpython.Py_INCREF(elem)
 *             cpython.PyList_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *     else:
*/
      PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
    }

    /* "asyncpg/protocol/codecs/array.pyx":309
 *         frb_read(buf, 4)
 * 
 *     if ndims == 1:             # <<<<<<<<<<<<<<
 *         # Fast path for flat arrays
 *         elem_count = dims[0]
*/
    goto __pyx_L8;
  }

  /* "asyncpg/protocol/codecs/array.pyx":326
 * 
 *     else:
 *         result = _nested_array_decode(settings, buf,             # <<<<<<<<<<<<<<
 *                                       decoder, decoder_arg, ndims, dims,
 *                                       &elem_buf)
*/
  /*else*/ {

    /* "asyncpg/protocol/codecs/array.pyx":328
 *         result = _nested_array_decode(settings, buf,
 *                                       decoder, decoder_arg, ndims, dims,
 *                                       &elem_buf)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(__pyx_v_settings, __pyx_v_buf, __pyx_v_decoder, __pyx_v_decoder_arg, __pyx_v_ndims, __pyx_v_dims, (&__pyx_v_elem_buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asyncpg/protocol/codecs/array.pyx":326
 * 
 *     else:
 *         result = _nested_array_decode(settings, buf,             # <<<<<<<<<<<<<<
 *                                       decoder, decoder_arg, ndims, dims,
 *                                       &elem_buf)
*/
    if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_3))) __PYX_ERR(2, 326, __pyx_L1_error)
    __pyx_v_result = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L8:;

  /* "asyncpg/protocol/codecs/array.pyx":330
 *                                       &elem_buf)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":276
 * 
 * 
 * cdef inline array_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                          decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.array_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":333
 * 
 * 
 * cdef _nested_array_decode(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf,
 *                           decode_func_ex decoder,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__nested_array_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, int32_t __pyx_v_ndims, int32_t *__pyx_v_dims, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_elem_buf) {
  int32_t __pyx_v_elem_len;
  int64_t __pyx_v_i;
  int64_t __pyx_v_j;
  int64_t __pyx_v_array_len;
  PyObject *__pyx_v_elem = 0;
  PyObject *__pyx_v_stride = 0;
  void *__pyx_v_strides[6];
  int32_t __pyx_v_indexes[6];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  int32_t __pyx_t_2;
  int64_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int64_t __pyx_t_10;
  int64_t __pyx_t_11;
  char const *__pyx_t_12;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13;
  int64_t __pyx_t_14;
  int64_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_nested_array_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":343
 *         int32_t elem_len
 *         int64_t i, j
 *         int64_t array_len = 1             # <<<<<<<<<<<<<<
 *         object elem, stride
 *         # An array of pointers to lists for each current array level.
*/
  __pyx_v_array_len = 1;

  /* "asyncpg/protocol/codecs/array.pyx":350
 *         int32_t indexes[ARRAY_MAXDIM]
 * 
 *     for i in range(ndims):             # <<<<<<<<<<<<<<
 *         array_len *= dims[i]
 *         indexes[i] = 0
*/
  __pyx_t_1 = __pyx_v_ndims;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "asyncpg/protocol/codecs/array.pyx":351
 * 
 *     for i in range(ndims):
 *         array_len *= dims[i]             # <<<<<<<<<<<<<<
 *         indexes[i] = 0
 *         strides[i] = NULL
*/
    __pyx_v_array_len = (__pyx_v_array_len * (__pyx_v_dims[__pyx_v_i]));

    /* "asyncpg/protocol/codecs/array.pyx":352
 *     for i in range(ndims):
 *         array_len *= dims[i]
 *         indexes[i] = 0             # <<<<<<<<<<<<<<
 *         strides[i] = NULL
 * 
*/
    (__pyx_v_indexes[__pyx_v_i]) = 0;

    /* "asyncpg/protocol/codecs/array.pyx":353
 *         array_len *= dims[i]
 *         indexes[i] = 0
 *         strides[i] = NULL             # <<<<<<<<<<<<<<
 * 
 *     if array_len == 0:
*/
    (__pyx_v_strides[__pyx_v_i]) = NULL;
  }

  /* "asyncpg/protocol/codecs/array.pyx":355
 *         strides[i] = NULL
 * 
 *     if array_len == 0:             # <<<<<<<<<<<<<<
 *         # A multidimensional array with a zero-sized dimension?
 *         return []
*/
  __pyx_t_4 = (__pyx_v_array_len == 0);
  if (__pyx_t_4) {

    /* "asyncpg/protocol/codecs/array.pyx":357
 *     if array_len == 0:
 *         # A multidimensional array with a zero-sized dimension?
 *         return []             # <<<<<<<<<<<<<<
 * 
 *     elif array_len < 0:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/array.pyx":355
 *         strides[i] = NULL
 * 
 *     if array_len == 0:             # <<<<<<<<<<<<<<
 *         # A multidimensional array with a zero-sized dimension?
 *         return []
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":359
 *         return []
 * 
 *     elif array_len < 0:             # <<<<<<<<<<<<<<
 *         # Array length overflow
 *         raise exceptions.ProtocolError('array length overflow')
*/
  __pyx_t_4 = (__pyx_v_array_len < 0);
  if (unlikely(__pyx_t_4)) {

    /* "asyncpg/protocol/codecs/array.pyx":361
 *     elif array_len < 0:
 *         # Array length overflow
 *         raise exceptions.ProtocolError('array length overflow')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(array_len):
*/
    __pyx_t_6 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_6);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_array_length_overflow};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(2, 361, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/array.pyx":359
 *         return []
 * 
 *     elif array_len < 0:             # <<<<<<<<<<<<<<
 *         # Array length overflow
 *         raise exceptions.ProtocolError('array length overflow')
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":363
 *         raise exceptions.ProtocolError('array length overflow')
 * 
 *     for i in range(array_len):             # <<<<<<<<<<<<<<
 *         # Decode the element.
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
*/
  __pyx_t_3 = __pyx_v_array_len;
  __pyx_t_10 = __pyx_t_3;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "asyncpg/protocol/codecs/array.pyx":365
 *     for i in range(array_len):
 *         # Decode the element.
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if elem_len == -1:
 *             elem = None
*/
    __pyx_t_12 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_12 == ((void *)NULL))) __PYX_ERR(2, 365, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_12);

    /* "asyncpg/protocol/codecs/array.pyx":366
 *         # Decode the element.
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             elem = None
 *         else:
*/
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "asyncpg/protocol/codecs/array.pyx":367
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:
 *             elem = None             # <<<<<<<<<<<<<<
 *         else:
 *             elem = decoder(settings,
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "asyncpg/protocol/codecs/array.pyx":366
 *         # Decode the element.
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             elem = None
 *         else:
*/
      goto __pyx_L8;
    }

    /* "asyncpg/protocol/codecs/array.pyx":369
 *             elem = None
 *         else:
 *             elem = decoder(settings,             # <<<<<<<<<<<<<<
 *                            frb_slice_from(elem_buf, buf, elem_len),
 *                            decoder_arg)
*/
    /*else*/ {

      /* "asyncpg/protocol/codecs/array.pyx":370
 *         else:
 *             elem = decoder(settings,
 *                            frb_slice_from(elem_buf, buf, elem_len),             # <<<<<<<<<<<<<<
 *                            decoder_arg)
 * 
*/
      __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from(__pyx_v_elem_buf, __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_13 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 370, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":369
 *             elem = None
 *         else:
 *             elem = decoder(settings,             # <<<<<<<<<<<<<<
 *                            frb_slice_from(elem_buf, buf, elem_len),
 *                            decoder_arg)
*/
      __pyx_t_5 = __pyx_v_decoder(__pyx_v_settings, __pyx_t_13, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L8:;

    /* "asyncpg/protocol/codecs/array.pyx":375
 *         # Take an explicit reference for PyList_SET_ITEM in the below
 *         # loop expects this.
 *         cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 * 
 *         # Iterate over array dimentions and put the element in
*/
    Py_INCREF(__pyx_v_elem);

    /* "asyncpg/protocol/codecs/array.pyx":379
 *         # Iterate over array dimentions and put the element in
 *         # the correctly nested sublist.
 *         for j in reversed(range(ndims)):             # <<<<<<<<<<<<<<
 *             if indexes[j] == 0:
 *                 # Allocate the list for this array level.
*/
    for (__pyx_t_14 = __pyx_v_ndims-1; __pyx_t_14 >= 0; __pyx_t_14-=1) {
      __pyx_v_j = __pyx_t_14;

      /* "asyncpg/protocol/codecs/array.pyx":380
 *         # the correctly nested sublist.
 *         for j in reversed(range(ndims)):
 *             if indexes[j] == 0:             # <<<<<<<<<<<<<<
 *                 # Allocate the list for this array level.
 *                 stride = cpython.PyList_New(dims[j])
*/
      __pyx_t_4 = ((__pyx_v_indexes[__pyx_v_j]) == 0);
      if (__pyx_t_4) {

        /* "asyncpg/protocol/codecs/array.pyx":382
 *             if indexes[j] == 0:
 *                 # Allocate the list for this array level.
 *                 stride = cpython.PyList_New(dims[j])             # <<<<<<<<<<<<<<
 * 
 *                 strides[j] = <void*><cpython.PyObject>stride
*/
        __pyx_t_5 = PyList_New((__pyx_v_dims[__pyx_v_j])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 382, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":384
 *                 stride = cpython.PyList_New(dims[j])
 * 
 *                 strides[j] = <void*><cpython.PyObject>stride             # <<<<<<<<<<<<<<
 *                 # Take an explicit reference for PyList_SET_ITEM below
 *                 # expects this.
*/
        (__pyx_v_strides[__pyx_v_j]) = ((void *)__pyx_v_stride);

        /* "asyncpg/protocol/codecs/array.pyx":387
 *                 # Take an explicit reference for PyList_SET_ITEM below
 *                 # expects this.
 *                 cpython.Py_INCREF(stride)             # <<<<<<<<<<<<<<
 * 
 *             stride = <object><cpython.PyObject*>strides[j]
*/
        Py_INCREF(__pyx_v_stride);

        /* "asyncpg/protocol/codecs/array.pyx":380
 *         # the correctly nested sublist.
 *         for j in reversed(range(ndims)):
 *             if indexes[j] == 0:             # <<<<<<<<<<<<<<
 *                 # Allocate the list for this array level.
 *                 stride = cpython.PyList_New(dims[j])
*/
      }

      /* "asyncpg/protocol/codecs/array.pyx":389
 *                 cpython.Py_INCREF(stride)
 * 
 *             stride = <object><cpython.PyObject*>strides[j]             # <<<<<<<<<<<<<<
 *             cpython.PyList_SET_ITEM(stride, indexes[j], elem)
 *             indexes[j] += 1
*/
      __pyx_t_5 = ((PyObject *)((PyObject *)(__pyx_v_strides[__pyx_v_j])));
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":390
 * 
 *             stride = <object><cpython.PyObject*>strides[j]
 *             cpython.PyList_SET_ITEM(stride, indexes[j], elem)             # <<<<<<<<<<<<<<
 *             indexes[j] += 1
 * 
*/
      PyList_SET_ITEM(__pyx_v_stride, (__pyx_v_indexes[__pyx_v_j]), __pyx_v_elem);

      /* "asyncpg/protocol/codecs/array.pyx":391
 *             stride = <object><cpython.PyObject*>strides[j]
 *             cpython.PyList_SET_ITEM(stride, indexes[j], elem)
 *             indexes[j] += 1             # <<<<<<<<<<<<<<
 * 
 *             if indexes[j] == dims[j] and j != 0:
*/
      __pyx_t_15 = __pyx_v_j;
      (__pyx_v_indexes[__pyx_t_15]) = ((__pyx_v_indexes[__pyx_t_15]) + 1);

      /* "asyncpg/protocol/codecs/array.pyx":393
 *             indexes[j] += 1
 * 
 *             if indexes[j] == dims[j] and j != 0:             # <<<<<<<<<<<<<<
 *                 # This array level is full, continue the
 *                 # ascent in the dimensions so that this level
*/
      __pyx_t_16 = ((__pyx_v_indexes[__pyx_v_j]) == (__pyx_v_dims[__pyx_v_j]));
      if (__pyx_t_16) {
      } else {
        __pyx_t_4 = __pyx_t_16;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_16 = (__pyx_v_j != 0);
      __pyx_t_4 = __pyx_t_16;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_4) {

        /* "asyncpg/protocol/codecs/array.pyx":397
 *                 # ascent in the dimensions so that this level
 *                 # sublist will be appened to the parent list.
 *                 elem = stride             # <<<<<<<<<<<<<<
 *                 # Reset the index, this will cause the
 *                 # new list to be allocated on the next
*/
        __Pyx_INCREF(__pyx_v_stride);
        __Pyx_DECREF_SET(__pyx_v_elem, __pyx_v_stride);

        /* "asyncpg/protocol/codecs/array.pyx":401
 *                 # new list to be allocated on the next
 *                 # iteration on this array axis.
 *                 indexes[j] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 break
*/
        (__pyx_v_indexes[__pyx_v_j]) = 0;

        /* "asyncpg/protocol/codecs/array.pyx":393
 *             indexes[j] += 1
 * 
 *             if indexes[j] == dims[j] and j != 0:             # <<<<<<<<<<<<<<
 *                 # This array level is full, continue the
 *                 # ascent in the dimensions so that this level
*/
        goto __pyx_L12;
      }

      /* "asyncpg/protocol/codecs/array.pyx":403
 *                 indexes[j] = 0
 *             else:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *     stride = <object><cpython.PyObject*>strides[0]
*/
      /*else*/ {
        goto __pyx_L10_break;
      }
      __pyx_L12:;
    }
    __pyx_L10_break:;
  }

  /* "asyncpg/protocol/codecs/array.pyx":405
 *                 break
 * 
 *     stride = <object><cpython.PyObject*>strides[0]             # <<<<<<<<<<<<<<
 *     # Since each element in strides has a refcount of 1,
 *     # returning strides[0] will increment it to 2, so
*/
  __pyx_t_5 = ((PyObject *)((PyObject *)(__pyx_v_strides[0])));
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":409
 *     # returning strides[0] will increment it to 2, so
 *     # balance that.
 *     cpython.Py_DECREF(stride)             # <<<<<<<<<<<<<<
 *     return stride
 * 
*/
  Py_DECREF(__pyx_v_stride);

  /* "asyncpg/protocol/codecs/array.pyx":410
 *     # balance that.
 *     cpython.Py_DECREF(stride)
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_stride);
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":333
 * 
 * 
 * cdef _nested_array_decode(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                           FRBuffer *buf,
 *                           decode_func_ex decoder,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._nested_array_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XDECREF(__pyx_v_stride);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":413
 * 
 * 
 * cdef textarray_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                       decode_func_ex decoder, const void *decoder_arg,
 *                       Py_UCS4 typdelim):
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, Py_UCS4 __pyx_v_typdelim) {
  Py_UCS4 *__pyx_v_array_text;
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_UCS4 *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  size_t __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  char const *__pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("textarray_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":422
 *     # Make a copy of array data since we will be mutating it for
 *     # the purposes of element decoding.
 *     s = pgproto.text_decode(settings, buf)             # <<<<<<<<<<<<<<
 *     array_text = cpythonx.PyUnicode_AsUCS4Copy(s)
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(2, 422, __pyx_L1_error)
  __pyx_v_s = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":423
 *     # the purposes of element decoding.
 *     s = pgproto.text_decode(settings, buf)
 *     array_text = cpythonx.PyUnicode_AsUCS4Copy(s)             # <<<<<<<<<<<<<<
 * 
 *     try:
*/
  __pyx_t_2 = PyUnicode_AsUCS4Copy(__pyx_v_s); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(2, 423, __pyx_L1_error)
  __pyx_v_array_text = __pyx_t_2;

  /* "asyncpg/protocol/codecs/array.pyx":425
 *     array_text = cpythonx.PyUnicode_AsUCS4Copy(s)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)
*/
  /*try:*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "asyncpg/protocol/codecs/array.pyx":426
 * 
 *     try:
 *         return _textarray_decode(             # <<<<<<<<<<<<<<
 *             settings, array_text, decoder, decoder_arg, typdelim)
 *     except ValueError as e:
*/
        __Pyx_XDECREF(__pyx_r);

        /* "asyncpg/protocol/codecs/array.pyx":427
 *     try:
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)             # <<<<<<<<<<<<<<
 *     except ValueError as e:
 *         raise exceptions.ProtocolError(
*/
        __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(__pyx_v_settings, __pyx_v_array_text, __pyx_v_decoder, __pyx_v_decoder_arg, __pyx_v_typdelim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 426, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L10_try_return;

        /* "asyncpg/protocol/codecs/array.pyx":425
 *     array_text = cpythonx.PyUnicode_AsUCS4Copy(s)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)
*/
      }
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":428
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)
 *     except ValueError as e:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'malformed array literal {!r}: {}'.format(s, e.args[0]))
*/
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
      if (__pyx_t_6) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(2, 428, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_v_e = __pyx_t_7;
        /*try:*/ {

          /* "asyncpg/protocol/codecs/array.pyx":429
 *             settings, array_text, decoder, decoder_arg, typdelim)
 *     except ValueError as e:
 *         raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *             'malformed array literal {!r}: {}'.format(s, e.args[0]))
 *     finally:
*/
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 429, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 429, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":430
 *     except ValueError as e:
 *         raise exceptions.ProtocolError(
 *             'malformed array literal {!r}: {}'.format(s, e.args[0]))             # <<<<<<<<<<<<<<
 *     finally:
 *         cpython.PyMem_Free(array_text)
*/
          __pyx_t_13 = __pyx_mstate_global->__pyx_kp_u_malformed_array_literal_r;
          __Pyx_INCREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 430, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 430, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_16 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_v_s, __pyx_t_15};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_16, (3-__pyx_t_16) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 430, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __pyx_t_16 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
            __pyx_t_16 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 429, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __Pyx_Raise(__pyx_t_9, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __PYX_ERR(2, 429, __pyx_L17_error)
        }

        /* "asyncpg/protocol/codecs/array.pyx":428
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)
 *     except ValueError as e:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'malformed array literal {!r}: {}'.format(s, e.args[0]))
*/
        /*finally:*/ {
          __pyx_L17_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
            if ( unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __Pyx_XGOTREF(__pyx_t_24);
            __pyx_t_6 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_23);
            __Pyx_XGIVEREF(__pyx_t_24);
            __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
            __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
            goto __pyx_L8_except_error;
          }
        }
      }
      goto __pyx_L8_except_error;

      /* "asyncpg/protocol/codecs/array.pyx":425
 *     array_text = cpythonx.PyUnicode_AsUCS4Copy(s)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return _textarray_decode(
 *             settings, array_text, decoder, decoder_arg, typdelim)
*/
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L4_error;
      __pyx_L10_try_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L3_return;
    }
  }

  /* "asyncpg/protocol/codecs/array.pyx":432
 *             'malformed array literal {!r}: {}'.format(s, e.args[0]))
 *     finally:
 *         cpython.PyMem_Free(array_text)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*finally:*/ {
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
      if ( unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_24);
      __Pyx_XGOTREF(__pyx_t_23);
      __Pyx_XGOTREF(__pyx_t_22);
      __pyx_t_17 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_25 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_array_text);
      }
      __Pyx_XGIVEREF(__pyx_t_24);
      __Pyx_XGIVEREF(__pyx_t_23);
      __Pyx_XGIVEREF(__pyx_t_22);
      __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
      __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_25;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_22 = __pyx_r;
      __pyx_r = 0;
      PyMem_Free(__pyx_v_array_text);
      __pyx_r = __pyx_t_22;
      __pyx_t_22 = 0;
      goto __pyx_L0;
    }
  }

  /* "asyncpg/protocol/codecs/array.pyx":413
 * 
 * 
 * cdef textarray_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                       decode_func_ex decoder, const void *decoder_arg,
 *                       Py_UCS4 typdelim):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":435
 * 
 * 
 * cdef _textarray_decode(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                        Py_UCS4 *array_text,
 *                        decode_func_ex decoder,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__textarray_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, Py_UCS4 *__pyx_v_array_text, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg, Py_UCS4 __pyx_v_typdelim) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_new_stride = 0;
  Py_UCS4 *__pyx_v_ptr;
  int32_t __pyx_v_ndims;
  int32_t __pyx_v_ubound;
  int32_t __pyx_v_lbound;
  int32_t __pyx_v_dims[6];
  int32_t __pyx_v_inferred_dims[6];
  int32_t __pyx_v_inferred_ndims;
  void *__pyx_v_strides[6];
  int32_t __pyx_v_indexes[6];
  int32_t __pyx_v_nest_level;
  int32_t __pyx_v_item_level;
  int __pyx_v_end_of_array;
  int __pyx_v_end_of_item;
  int __pyx_v_has_quoting;
  int __pyx_v_strip_spaces;
  int __pyx_v_in_quotes;
  Py_UCS4 *__pyx_v_item_start;
  Py_UCS4 *__pyx_v_item_ptr;
  Py_UCS4 *__pyx_v_item_end;
  int __pyx_v_i;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_v_item_text = 0;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_item_buf;
  char *__pyx_v_pg_item_str;
  Py_ssize_t __pyx_v_pg_item_len;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_UCS4 *__pyx_t_8;
  int32_t __pyx_t_9;
  int32_t __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12;
  int __pyx_t_13;
  long __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_textarray_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":446
 *         list new_stride
 *         Py_UCS4 *ptr
 *         int32_t ndims = 0             # <<<<<<<<<<<<<<
 *         int32_t ubound = 0
 *         int32_t lbound = 0
*/
  __pyx_v_ndims = 0;

  /* "asyncpg/protocol/codecs/array.pyx":447
 *         Py_UCS4 *ptr
 *         int32_t ndims = 0
 *         int32_t ubound = 0             # <<<<<<<<<<<<<<
 *         int32_t lbound = 0
 *         int32_t dims[ARRAY_MAXDIM]
*/
  __pyx_v_ubound = 0;

  /* "asyncpg/protocol/codecs/array.pyx":448
 *         int32_t ndims = 0
 *         int32_t ubound = 0
 *         int32_t lbound = 0             # <<<<<<<<<<<<<<
 *         int32_t dims[ARRAY_MAXDIM]
 *         int32_t inferred_dims[ARRAY_MAXDIM]
*/
  __pyx_v_lbound = 0;

  /* "asyncpg/protocol/codecs/array.pyx":451
 *         int32_t dims[ARRAY_MAXDIM]
 *         int32_t inferred_dims[ARRAY_MAXDIM]
 *         int32_t inferred_ndims = 0             # <<<<<<<<<<<<<<
 *         void *strides[ARRAY_MAXDIM]
 *         int32_t indexes[ARRAY_MAXDIM]
*/
  __pyx_v_inferred_ndims = 0;

  /* "asyncpg/protocol/codecs/array.pyx":454
 *         void *strides[ARRAY_MAXDIM]
 *         int32_t indexes[ARRAY_MAXDIM]
 *         int32_t nest_level = 0             # <<<<<<<<<<<<<<
 *         int32_t item_level = 0
 *         bint end_of_array = False
*/
  __pyx_v_nest_level = 0;

  /* "asyncpg/protocol/codecs/array.pyx":455
 *         int32_t indexes[ARRAY_MAXDIM]
 *         int32_t nest_level = 0
 *         int32_t item_level = 0             # <<<<<<<<<<<<<<
 *         bint end_of_array = False
 * 
*/
  __pyx_v_item_level = 0;

  /* "asyncpg/protocol/codecs/array.pyx":456
 *         int32_t nest_level = 0
 *         int32_t item_level = 0
 *         bint end_of_array = False             # <<<<<<<<<<<<<<
 * 
 *         bint end_of_item = False
*/
  __pyx_v_end_of_array = 0;

  /* "asyncpg/protocol/codecs/array.pyx":458
 *         bint end_of_array = False
 * 
 *         bint end_of_item = False             # <<<<<<<<<<<<<<
 *         bint has_quoting = False
 *         bint strip_spaces = False
*/
  __pyx_v_end_of_item = 0;

  /* "asyncpg/protocol/codecs/array.pyx":459
 * 
 *         bint end_of_item = False
 *         bint has_quoting = False             # <<<<<<<<<<<<<<
 *         bint strip_spaces = False
 *         bint in_quotes = False
*/
  __pyx_v_has_quoting = 0;

  /* "asyncpg/protocol/codecs/array.pyx":460
 *         bint end_of_item = False
 *         bint has_quoting = False
 *         bint strip_spaces = False             # <<<<<<<<<<<<<<
 *         bint in_quotes = False
 *         Py_UCS4 *item_start
*/
  __pyx_v_strip_spaces = 0;

  /* "asyncpg/protocol/codecs/array.pyx":461
 *         bint has_quoting = False
 *         bint strip_spaces = False
 *         bint in_quotes = False             # <<<<<<<<<<<<<<
 *         Py_UCS4 *item_start
 *         Py_UCS4 *item_ptr
*/
  __pyx_v_in_quotes = 0;

  /* "asyncpg/protocol/codecs/array.pyx":473
 *         ssize_t pg_item_len
 * 
 *     ptr = array_text             # <<<<<<<<<<<<<<
 * 
 *     while True:
*/
  __pyx_v_ptr = __pyx_v_array_text;

  /* "asyncpg/protocol/codecs/array.pyx":475
 *     ptr = array_text
 * 
 *     while True:             # <<<<<<<<<<<<<<
 *         while apg_ascii_isspace(ptr[0]):
 *             ptr += 1
*/
  while (1) {

    /* "asyncpg/protocol/codecs/array.pyx":476
 * 
 *     while True:
 *         while apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *             ptr += 1
 * 
*/
    while (1) {
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 476, __pyx_L1_error)
      if (!__pyx_t_1) break;

      /* "asyncpg/protocol/codecs/array.pyx":477
 *     while True:
 *         while apg_ascii_isspace(ptr[0]):
 *             ptr += 1             # <<<<<<<<<<<<<<
 * 
 *         if ptr[0] != '[':
*/
      __pyx_v_ptr = (__pyx_v_ptr + 1);
    }

    /* "asyncpg/protocol/codecs/array.pyx":479
 *             ptr += 1
 * 
 *         if ptr[0] != '[':             # <<<<<<<<<<<<<<
 *             # Finished parsing dimensions spec.
 *             break
*/
    __pyx_t_1 = ((__pyx_v_ptr[0]) != 91);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/array.pyx":481
 *         if ptr[0] != '[':
 *             # Finished parsing dimensions spec.
 *             break             # <<<<<<<<<<<<<<
 * 
 *         ptr += 1  # '['
*/
      goto __pyx_L4_break;

      /* "asyncpg/protocol/codecs/array.pyx":479
 *             ptr += 1
 * 
 *         if ptr[0] != '[':             # <<<<<<<<<<<<<<
 *             # Finished parsing dimensions spec.
 *             break
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":483
 *             break
 * 
 *         ptr += 1  # '['             # <<<<<<<<<<<<<<
 * 
 *         if ndims > ARRAY_MAXDIM:
*/
    __pyx_v_ptr = (__pyx_v_ptr + 1);

    /* "asyncpg/protocol/codecs/array.pyx":485
 *         ptr += 1  # '['
 * 
 *         if ndims > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'number of array dimensions ({}) exceed the '
*/
    __pyx_t_1 = (__pyx_v_ndims > 6);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/array.pyx":486
 * 
 *         if ndims > ARRAY_MAXDIM:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'number of array dimensions ({}) exceed the '
 *                 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM))
*/
      __pyx_t_3 = NULL;

      /* "asyncpg/protocol/codecs/array.pyx":488
 *             raise ValueError(
 *                 'number of array dimensions ({}) exceed the '
 *                 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM))             # <<<<<<<<<<<<<<
 * 
 *         ptr = apg_parse_int32(ptr, &ubound)
*/
      __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int32_t(__pyx_v_ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_mstate_global->__pyx_int_6};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 486, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":485
 *         ptr += 1  # '['
 * 
 *         if ndims > ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'number of array dimensions ({}) exceed the '
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":490
 *                 'maximum expected ({})'.format(ndims, ARRAY_MAXDIM))
 * 
 *         ptr = apg_parse_int32(ptr, &ubound)             # <<<<<<<<<<<<<<
 *         if ptr == NULL:
 *             raise ValueError('missing array dimension value')
*/
    __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 490, __pyx_L1_error)
    __pyx_v_ptr = __pyx_t_8;

    /* "asyncpg/protocol/codecs/array.pyx":491
 * 
 *         ptr = apg_parse_int32(ptr, &ubound)
 *         if ptr == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('missing array dimension value')
 * 
*/
    __pyx_t_1 = (__pyx_v_ptr == NULL);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/array.pyx":492
 *         ptr = apg_parse_int32(ptr, &ubound)
 *         if ptr == NULL:
 *             raise ValueError('missing array dimension value')             # <<<<<<<<<<<<<<
 * 
 *         if ptr[0] == ':':
*/
      __pyx_t_4 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_array_dimension_value};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 492, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 492, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":491
 * 
 *         ptr = apg_parse_int32(ptr, &ubound)
 *         if ptr == NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError('missing array dimension value')
 * 
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":494
 *             raise ValueError('missing array dimension value')
 * 
 *         if ptr[0] == ':':             # <<<<<<<<<<<<<<
 *             ptr += 1
 *             lbound = ubound
*/
    __pyx_t_1 = ((__pyx_v_ptr[0]) == 58);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/array.pyx":495
 * 
 *         if ptr[0] == ':':
 *             ptr += 1             # <<<<<<<<<<<<<<
 *             lbound = ubound
 * 
*/
      __pyx_v_ptr = (__pyx_v_ptr + 1);

      /* "asyncpg/protocol/codecs/array.pyx":496
 *         if ptr[0] == ':':
 *             ptr += 1
 *             lbound = ubound             # <<<<<<<<<<<<<<
 * 
 *             # [lower:upper] spec.  We disregard the lbound for decoding.
*/
      __pyx_v_lbound = __pyx_v_ubound;

      /* "asyncpg/protocol/codecs/array.pyx":499
 * 
 *             # [lower:upper] spec.  We disregard the lbound for decoding.
 *             ptr = apg_parse_int32(ptr, &ubound)             # <<<<<<<<<<<<<<
 *             if ptr == NULL:
 *                 raise ValueError('missing array dimension value')
*/
      __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_apg_parse_int32(__pyx_v_ptr, (&__pyx_v_ubound)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 499, __pyx_L1_error)
      __pyx_v_ptr = __pyx_t_8;

      /* "asyncpg/protocol/codecs/array.pyx":500
 *             # [lower:upper] spec.  We disregard the lbound for decoding.
 *             ptr = apg_parse_int32(ptr, &ubound)
 *             if ptr == NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('missing array dimension value')
 *         else:
*/
      __pyx_t_1 = (__pyx_v_ptr == NULL);
      if (unlikely(__pyx_t_1)) {

        /* "asyncpg/protocol/codecs/array.pyx":501
 *             ptr = apg_parse_int32(ptr, &ubound)
 *             if ptr == NULL:
 *                 raise ValueError('missing array dimension value')             # <<<<<<<<<<<<<<
 *         else:
 *             lbound = 1
*/
        __pyx_t_4 = NULL;
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_array_dimension_value};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 501, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(2, 501, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/array.pyx":500
 *             # [lower:upper] spec.  We disregard the lbound for decoding.
 *             ptr = apg_parse_int32(ptr, &ubound)
 *             if ptr == NULL:             # <<<<<<<<<<<<<<
 *                 raise ValueError('missing array dimension value')
 *         else:
*/
      }

      /* "asyncpg/protocol/codecs/array.pyx":494
 *             raise ValueError('missing array dimension value')
 * 
 *         if ptr[0] == ':':             # <<<<<<<<<<<<<<
 *             ptr += 1
 *             lbound = ubound
*/
      goto __pyx_L10;
    }

    /* "asyncpg/protocol/codecs/array.pyx":503
 *                 raise ValueError('missing array dimension value')
 *         else:
 *             lbound = 1             # <<<<<<<<<<<<<<
 * 
 *         if ptr[0] != ']':
*/
    /*else*/ {
      __pyx_v_lbound = 1;
    }
    __pyx_L10:;

    /* "asyncpg/protocol/codecs/array.pyx":505
 *             lbound = 1
 * 
 *         if ptr[0] != ']':             # <<<<<<<<<<<<<<
 *             raise ValueError('missing \']\' after array dimensions')
 * 
*/
    __pyx_t_1 = ((__pyx_v_ptr[0]) != 93);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/array.pyx":506
 * 
 *         if ptr[0] != ']':
 *             raise ValueError('missing \']\' after array dimensions')             # <<<<<<<<<<<<<<
 * 
 *         ptr += 1  # ']'
*/
      __pyx_t_4 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 506, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":505
 *             lbound = 1
 * 
 *         if ptr[0] != ']':             # <<<<<<<<<<<<<<
 *             raise ValueError('missing \']\' after array dimensions')
 * 
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":508
 *             raise ValueError('missing \']\' after array dimensions')
 * 
 *         ptr += 1  # ']'             # <<<<<<<<<<<<<<
 * 
 *         dims[ndims] = ubound - lbound + 1
*/
    __pyx_v_ptr = (__pyx_v_ptr + 1);

    /* "asyncpg/protocol/codecs/array.pyx":510
 *         ptr += 1  # ']'
 * 
 *         dims[ndims] = ubound - lbound + 1             # <<<<<<<<<<<<<<
 *         ndims += 1
 * 
*/
    (__pyx_v_dims[__pyx_v_ndims]) = ((__pyx_v_ubound - __pyx_v_lbound) + 1);

    /* "asyncpg/protocol/codecs/array.pyx":511
 * 
 *         dims[ndims] = ubound - lbound + 1
 *         ndims += 1             # <<<<<<<<<<<<<<
 * 
 *     if ndims != 0:
*/
    __pyx_v_ndims = (__pyx_v_ndims + 1);
  }
  __pyx_L4_break:;

  /* "asyncpg/protocol/codecs/array.pyx":513
 *         ndims += 1
 * 
 *     if ndims != 0:             # <<<<<<<<<<<<<<
 *         # If dimensions were given, the '=' token is expected.
 *         if ptr[0] != '=':
*/
  __pyx_t_1 = (__pyx_v_ndims != 0);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/array.pyx":515
 *     if ndims != 0:
 *         # If dimensions were given, the '=' token is expected.
 *         if ptr[0] != '=':             # <<<<<<<<<<<<<<
 *             raise ValueError('missing \'=\' after array dimensions')
 * 
*/
    __pyx_t_1 = ((__pyx_v_ptr[0]) != 61);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/array.pyx":516
 *         # If dimensions were given, the '=' token is expected.
 *         if ptr[0] != '=':
 *             raise ValueError('missing \'=\' after array dimensions')             # <<<<<<<<<<<<<<
 * 
 *         ptr += 1  # '='
*/
      __pyx_t_4 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_missing_after_array_dimensions_2};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 516, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 516, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":515
 *     if ndims != 0:
 *         # If dimensions were given, the '=' token is expected.
 *         if ptr[0] != '=':             # <<<<<<<<<<<<<<
 *             raise ValueError('missing \'=\' after array dimensions')
 * 
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":518
 *             raise ValueError('missing \'=\' after array dimensions')
 * 
 *         ptr += 1  # '='             # <<<<<<<<<<<<<<
 * 
 *         # Skip any whitespace after the '=', whitespace
*/
    __pyx_v_ptr = (__pyx_v_ptr + 1);

    /* "asyncpg/protocol/codecs/array.pyx":522
 *         # Skip any whitespace after the '=', whitespace
 *         # before was consumed in the above loop.
 *         while apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *             ptr += 1
 * 
*/
    while (1) {
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 522, __pyx_L1_error)
      if (!__pyx_t_1) break;

      /* "asyncpg/protocol/codecs/array.pyx":523
 *         # before was consumed in the above loop.
 *         while apg_ascii_isspace(ptr[0]):
 *             ptr += 1             # <<<<<<<<<<<<<<
 * 
 *         # Infer the dimensions from the brace structure in the
*/
      __pyx_v_ptr = (__pyx_v_ptr + 1);
    }

    /* "asyncpg/protocol/codecs/array.pyx":528
 *         # array literal body, and check that it matches the explicit
 *         # spec.  This also validates that the array literal is sane.
 *         _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims)             # <<<<<<<<<<<<<<
 * 
 *         if inferred_ndims != ndims:
*/
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_inferred_dims, (&__pyx_v_inferred_ndims)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/codecs/array.pyx":530
 *         _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims)
 * 
 *         if inferred_ndims != ndims:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'specified array dimensions do not match array content')
*/
    __pyx_t_1 = (__pyx_v_inferred_ndims != __pyx_v_ndims);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/codecs/array.pyx":531
 * 
 *         if inferred_ndims != ndims:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'specified array dimensions do not match array content')
 * 
*/
      __pyx_t_4 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_specified_array_dimensions_do_no};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 531, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(2, 531, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":530
 *         _infer_array_dims(ptr, typdelim, inferred_dims, &inferred_ndims)
 * 
 *         if inferred_ndims != ndims:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 'specified array dimensions do not match array content')
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":534
 *                 'specified array dimensions do not match array content')
 * 
 *         for i in range(ndims):             # <<<<<<<<<<<<<<
 *             if inferred_dims[i] != dims[i]:
 *                 raise ValueError(
*/
    __pyx_t_9 = __pyx_v_ndims;
    __pyx_t_10 = __pyx_t_9;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "asyncpg/protocol/codecs/array.pyx":535
 * 
 *         for i in range(ndims):
 *             if inferred_dims[i] != dims[i]:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'specified array dimensions do not match array content')
*/
      __pyx_t_1 = ((__pyx_v_inferred_dims[__pyx_v_i]) != (__pyx_v_dims[__pyx_v_i]));
      if (unlikely(__pyx_t_1)) {

        /* "asyncpg/protocol/codecs/array.pyx":536
 *         for i in range(ndims):
 *             if inferred_dims[i] != dims[i]:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'specified array dimensions do not match array content')
 *     else:
*/
        __pyx_t_4 = NULL;
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_specified_array_dimensions_do_no};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 536, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(2, 536, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/array.pyx":535
 * 
 *         for i in range(ndims):
 *             if inferred_dims[i] != dims[i]:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'specified array dimensions do not match array content')
*/
      }
    }

    /* "asyncpg/protocol/codecs/array.pyx":513
 *         ndims += 1
 * 
 *     if ndims != 0:             # <<<<<<<<<<<<<<
 *         # If dimensions were given, the '=' token is expected.
 *         if ptr[0] != '=':
*/
    goto __pyx_L13;
  }

  /* "asyncpg/protocol/codecs/array.pyx":541
 *         # Infer the dimensions from the brace structure in the array literal
 *         # body.  This also validates that the array literal is sane.
 *         _infer_array_dims(ptr, typdelim, dims, &ndims)             # <<<<<<<<<<<<<<
 * 
 *     while not end_of_array:
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(__pyx_v_ptr, __pyx_v_typdelim, __pyx_v_dims, (&__pyx_v_ndims)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L13:;

  /* "asyncpg/protocol/codecs/array.pyx":543
 *         _infer_array_dims(ptr, typdelim, dims, &ndims)
 * 
 *     while not end_of_array:             # <<<<<<<<<<<<<<
 *         # We iterate over the literal character by character
 *         # and modify the string in-place removing the array-specific
*/
  while (1) {
    __pyx_t_1 = (!__pyx_v_end_of_array);
    if (!__pyx_t_1) break;

    /* "asyncpg/protocol/codecs/array.pyx":547
 *         # and modify the string in-place removing the array-specific
 *         # quoting and determining the boundaries of each element.
 *         end_of_item = has_quoting = in_quotes = False             # <<<<<<<<<<<<<<
 *         strip_spaces = True
 * 
*/
    __pyx_v_end_of_item = 0;
    __pyx_v_has_quoting = 0;
    __pyx_v_in_quotes = 0;

    /* "asyncpg/protocol/codecs/array.pyx":548
 *         # quoting and determining the boundaries of each element.
 *         end_of_item = has_quoting = in_quotes = False
 *         strip_spaces = True             # <<<<<<<<<<<<<<
 * 
 *         # Pointers to array element start, end, and the current pointer
*/
    __pyx_v_strip_spaces = 1;

    /* "asyncpg/protocol/codecs/array.pyx":553
 *         # tracking the position where characters are written when
 *         # escaping is folded.
 *         item_start = item_end = item_ptr = ptr             # <<<<<<<<<<<<<<
 *         item_level = 0
 * 
*/
    __pyx_v_item_start = __pyx_v_ptr;
    __pyx_v_item_end = __pyx_v_ptr;
    __pyx_v_item_ptr = __pyx_v_ptr;

    /* "asyncpg/protocol/codecs/array.pyx":554
 *         # escaping is folded.
 *         item_start = item_end = item_ptr = ptr
 *         item_level = 0             # <<<<<<<<<<<<<<
 * 
 *         while not end_of_item:
*/
    __pyx_v_item_level = 0;

    /* "asyncpg/protocol/codecs/array.pyx":556
 *         item_level = 0
 * 
 *         while not end_of_item:             # <<<<<<<<<<<<<<
 *             if ptr[0] == '"':
 *                 in_quotes = not in_quotes
*/
    while (1) {
      __pyx_t_1 = (!__pyx_v_end_of_item);
      if (!__pyx_t_1) break;

      /* "asyncpg/protocol/codecs/array.pyx":557
 * 
 *         while not end_of_item:
 *             if ptr[0] == '"':             # <<<<<<<<<<<<<<
 *                 in_quotes = not in_quotes
 *                 if in_quotes:
*/
      __pyx_t_1 = ((__pyx_v_ptr[0]) == 34);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":558
 *         while not end_of_item:
 *             if ptr[0] == '"':
 *                 in_quotes = not in_quotes             # <<<<<<<<<<<<<<
 *                 if in_quotes:
 *                     strip_spaces = False
*/
        __pyx_v_in_quotes = (!__pyx_v_in_quotes);

        /* "asyncpg/protocol/codecs/array.pyx":559
 *             if ptr[0] == '"':
 *                 in_quotes = not in_quotes
 *                 if in_quotes:             # <<<<<<<<<<<<<<
 *                     strip_spaces = False
 *                 else:
*/
        if (__pyx_v_in_quotes) {

          /* "asyncpg/protocol/codecs/array.pyx":560
 *                 in_quotes = not in_quotes
 *                 if in_quotes:
 *                     strip_spaces = False             # <<<<<<<<<<<<<<
 *                 else:
 *                     item_end = item_ptr
*/
          __pyx_v_strip_spaces = 0;

          /* "asyncpg/protocol/codecs/array.pyx":559
 *             if ptr[0] == '"':
 *                 in_quotes = not in_quotes
 *                 if in_quotes:             # <<<<<<<<<<<<<<
 *                     strip_spaces = False
 *                 else:
*/
          goto __pyx_L26;
        }

        /* "asyncpg/protocol/codecs/array.pyx":562
 *                     strip_spaces = False
 *                 else:
 *                     item_end = item_ptr             # <<<<<<<<<<<<<<
 *                 has_quoting = True
 * 
*/
        /*else*/ {
          __pyx_v_item_end = __pyx_v_item_ptr;
        }
        __pyx_L26:;

        /* "asyncpg/protocol/codecs/array.pyx":563
 *                 else:
 *                     item_end = item_ptr
 *                 has_quoting = True             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '\\':
*/
        __pyx_v_has_quoting = 1;

        /* "asyncpg/protocol/codecs/array.pyx":557
 * 
 *         while not end_of_item:
 *             if ptr[0] == '"':             # <<<<<<<<<<<<<<
 *                 in_quotes = not in_quotes
 *                 if in_quotes:
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":565
 *                 has_quoting = True
 * 
 *             elif ptr[0] == '\\':             # <<<<<<<<<<<<<<
 *                 # Quoted character, collapse the backslash.
 *                 ptr += 1
*/
      __pyx_t_1 = ((__pyx_v_ptr[0]) == 92);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":567
 *             elif ptr[0] == '\\':
 *                 # Quoted character, collapse the backslash.
 *                 ptr += 1             # <<<<<<<<<<<<<<
 *                 has_quoting = True
 *                 item_ptr[0] = ptr[0]
*/
        __pyx_v_ptr = (__pyx_v_ptr + 1);

        /* "asyncpg/protocol/codecs/array.pyx":568
 *                 # Quoted character, collapse the backslash.
 *                 ptr += 1
 *                 has_quoting = True             # <<<<<<<<<<<<<<
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1
*/
        __pyx_v_has_quoting = 1;

        /* "asyncpg/protocol/codecs/array.pyx":569
 *                 ptr += 1
 *                 has_quoting = True
 *                 item_ptr[0] = ptr[0]             # <<<<<<<<<<<<<<
 *                 item_ptr += 1
 *                 strip_spaces = False
*/
        (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]);

        /* "asyncpg/protocol/codecs/array.pyx":570
 *                 has_quoting = True
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1             # <<<<<<<<<<<<<<
 *                 strip_spaces = False
 *                 item_end = item_ptr
*/
        __pyx_v_item_ptr = (__pyx_v_item_ptr + 1);

        /* "asyncpg/protocol/codecs/array.pyx":571
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1
 *                 strip_spaces = False             # <<<<<<<<<<<<<<
 *                 item_end = item_ptr
 * 
*/
        __pyx_v_strip_spaces = 0;

        /* "asyncpg/protocol/codecs/array.pyx":572
 *                 item_ptr += 1
 *                 strip_spaces = False
 *                 item_end = item_ptr             # <<<<<<<<<<<<<<
 * 
 *             elif in_quotes:
*/
        __pyx_v_item_end = __pyx_v_item_ptr;

        /* "asyncpg/protocol/codecs/array.pyx":565
 *                 has_quoting = True
 * 
 *             elif ptr[0] == '\\':             # <<<<<<<<<<<<<<
 *                 # Quoted character, collapse the backslash.
 *                 ptr += 1
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":574
 *                 item_end = item_ptr
 * 
 *             elif in_quotes:             # <<<<<<<<<<<<<<
 *                 # Consume the string until we see the closing quote.
 *                 item_ptr[0] = ptr[0]
*/
      if (__pyx_v_in_quotes) {

        /* "asyncpg/protocol/codecs/array.pyx":576
 *             elif in_quotes:
 *                 # Consume the string until we see the closing quote.
 *                 item_ptr[0] = ptr[0]             # <<<<<<<<<<<<<<
 *                 item_ptr += 1
 * 
*/
        (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]);

        /* "asyncpg/protocol/codecs/array.pyx":577
 *                 # Consume the string until we see the closing quote.
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '{':
*/
        __pyx_v_item_ptr = (__pyx_v_item_ptr + 1);

        /* "asyncpg/protocol/codecs/array.pyx":574
 *                 item_end = item_ptr
 * 
 *             elif in_quotes:             # <<<<<<<<<<<<<<
 *                 # Consume the string until we see the closing quote.
 *                 item_ptr[0] = ptr[0]
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":579
 *                 item_ptr += 1
 * 
 *             elif ptr[0] == '{':             # <<<<<<<<<<<<<<
 *                 # Nesting level increase.
 *                 nest_level += 1
*/
      __pyx_t_1 = ((__pyx_v_ptr[0]) == 0x7B);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":581
 *             elif ptr[0] == '{':
 *                 # Nesting level increase.
 *                 nest_level += 1             # <<<<<<<<<<<<<<
 * 
 *                 indexes[nest_level - 1] = 0
*/
        __pyx_v_nest_level = (__pyx_v_nest_level + 1);

        /* "asyncpg/protocol/codecs/array.pyx":583
 *                 nest_level += 1
 * 
 *                 indexes[nest_level - 1] = 0             # <<<<<<<<<<<<<<
 *                 new_stride = cpython.PyList_New(dims[nest_level - 1])
 *                 strides[nest_level - 1] = \
*/
        (__pyx_v_indexes[(__pyx_v_nest_level - 1)]) = 0;

        /* "asyncpg/protocol/codecs/array.pyx":584
 * 
 *                 indexes[nest_level - 1] = 0
 *                 new_stride = cpython.PyList_New(dims[nest_level - 1])             # <<<<<<<<<<<<<<
 *                 strides[nest_level - 1] = \
 *                     <void*>(<cpython.PyObject>new_stride)
*/
        __pyx_t_2 = PyList_New((__pyx_v_dims[(__pyx_v_nest_level - 1)])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF_SET(__pyx_v_new_stride, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;

        /* "asyncpg/protocol/codecs/array.pyx":585
 *                 indexes[nest_level - 1] = 0
 *                 new_stride = cpython.PyList_New(dims[nest_level - 1])
 *                 strides[nest_level - 1] = \             # <<<<<<<<<<<<<<
 *                     <void*>(<cpython.PyObject>new_stride)
 * 
*/
        (__pyx_v_strides[(__pyx_v_nest_level - 1)]) = ((void *)__pyx_v_new_stride);

        /* "asyncpg/protocol/codecs/array.pyx":588
 *                     <void*>(<cpython.PyObject>new_stride)
 * 
 *                 if nest_level > 1:             # <<<<<<<<<<<<<<
 *                     cpython.Py_INCREF(new_stride)
 *                     cpython.PyList_SET_ITEM(
*/
        __pyx_t_1 = (__pyx_v_nest_level > 1);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/array.pyx":589
 * 
 *                 if nest_level > 1:
 *                     cpython.Py_INCREF(new_stride)             # <<<<<<<<<<<<<<
 *                     cpython.PyList_SET_ITEM(
 *                         <object><cpython.PyObject*>strides[nest_level - 2],
*/
          Py_INCREF(__pyx_v_new_stride);

          /* "asyncpg/protocol/codecs/array.pyx":591
 *                     cpython.Py_INCREF(new_stride)
 *                     cpython.PyList_SET_ITEM(
 *                         <object><cpython.PyObject*>strides[nest_level - 2],             # <<<<<<<<<<<<<<
 *                         indexes[nest_level - 2],
 *                         new_stride)
*/
          __pyx_t_12 = ((PyObject *)(__pyx_v_strides[(__pyx_v_nest_level - 2)]));

          /* "asyncpg/protocol/codecs/array.pyx":590
 *                 if nest_level > 1:
 *                     cpython.Py_INCREF(new_stride)
 *                     cpython.PyList_SET_ITEM(             # <<<<<<<<<<<<<<
 *                         <object><cpython.PyObject*>strides[nest_level - 2],
 *                         indexes[nest_level - 2],
*/
          PyList_SET_ITEM(((PyObject *)__pyx_t_12), (__pyx_v_indexes[(__pyx_v_nest_level - 2)]), __pyx_v_new_stride);

          /* "asyncpg/protocol/codecs/array.pyx":588
 *                     <void*>(<cpython.PyObject>new_stride)
 * 
 *                 if nest_level > 1:             # <<<<<<<<<<<<<<
 *                     cpython.Py_INCREF(new_stride)
 *                     cpython.PyList_SET_ITEM(
*/
          goto __pyx_L27;
        }

        /* "asyncpg/protocol/codecs/array.pyx":595
 *                         new_stride)
 *                 else:
 *                     result = new_stride             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '}':
*/
        /*else*/ {
          __Pyx_INCREF(__pyx_v_new_stride);
          __Pyx_XDECREF_SET(__pyx_v_result, __pyx_v_new_stride);
        }
        __pyx_L27:;

        /* "asyncpg/protocol/codecs/array.pyx":579
 *                 item_ptr += 1
 * 
 *             elif ptr[0] == '{':             # <<<<<<<<<<<<<<
 *                 # Nesting level increase.
 *                 nest_level += 1
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":597
 *                     result = new_stride
 * 
 *             elif ptr[0] == '}':             # <<<<<<<<<<<<<<
 *                 if item_level == 0:
 *                     # Make sure we keep track of which nesting
*/
      __pyx_t_1 = ((__pyx_v_ptr[0]) == 0x7D);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":598
 * 
 *             elif ptr[0] == '}':
 *                 if item_level == 0:             # <<<<<<<<<<<<<<
 *                     # Make sure we keep track of which nesting
 *                     # level the item belongs to, as the loop
*/
        __pyx_t_1 = (__pyx_v_item_level == 0);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/array.pyx":603
 *                     # will continue to consume closing braces
 *                     # until the delimiter or the end of input.
 *                     item_level = nest_level             # <<<<<<<<<<<<<<
 * 
 *                 nest_level -= 1
*/
          __pyx_v_item_level = __pyx_v_nest_level;

          /* "asyncpg/protocol/codecs/array.pyx":598
 * 
 *             elif ptr[0] == '}':
 *                 if item_level == 0:             # <<<<<<<<<<<<<<
 *                     # Make sure we keep track of which nesting
 *                     # level the item belongs to, as the loop
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":605
 *                     item_level = nest_level
 * 
 *                 nest_level -= 1             # <<<<<<<<<<<<<<
 * 
 *                 if nest_level == 0:
*/
        __pyx_v_nest_level = (__pyx_v_nest_level - 1);

        /* "asyncpg/protocol/codecs/array.pyx":607
 *                 nest_level -= 1
 * 
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     end_of_array = end_of_item = True
 * 
*/
        __pyx_t_1 = (__pyx_v_nest_level == 0);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/array.pyx":608
 * 
 *                 if nest_level == 0:
 *                     end_of_array = end_of_item = True             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == typdelim:
*/
          __pyx_v_end_of_array = 1;
          __pyx_v_end_of_item = 1;

          /* "asyncpg/protocol/codecs/array.pyx":607
 *                 nest_level -= 1
 * 
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     end_of_array = end_of_item = True
 * 
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":597
 *                     result = new_stride
 * 
 *             elif ptr[0] == '}':             # <<<<<<<<<<<<<<
 *                 if item_level == 0:
 *                     # Make sure we keep track of which nesting
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":610
 *                     end_of_array = end_of_item = True
 * 
 *             elif ptr[0] == typdelim:             # <<<<<<<<<<<<<<
 *                 # Array element delimiter,
 *                 end_of_item = True
*/
      __pyx_t_1 = ((__pyx_v_ptr[0]) == __pyx_v_typdelim);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":612
 *             elif ptr[0] == typdelim:
 *                 # Array element delimiter,
 *                 end_of_item = True             # <<<<<<<<<<<<<<
 *                 if item_level == 0:
 *                     item_level = nest_level
*/
        __pyx_v_end_of_item = 1;

        /* "asyncpg/protocol/codecs/array.pyx":613
 *                 # Array element delimiter,
 *                 end_of_item = True
 *                 if item_level == 0:             # <<<<<<<<<<<<<<
 *                     item_level = nest_level
 * 
*/
        __pyx_t_1 = (__pyx_v_item_level == 0);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/array.pyx":614
 *                 end_of_item = True
 *                 if item_level == 0:
 *                     item_level = nest_level             # <<<<<<<<<<<<<<
 * 
 *             elif apg_ascii_isspace(ptr[0]):
*/
          __pyx_v_item_level = __pyx_v_nest_level;

          /* "asyncpg/protocol/codecs/array.pyx":613
 *                 # Array element delimiter,
 *                 end_of_item = True
 *                 if item_level == 0:             # <<<<<<<<<<<<<<
 *                     item_level = nest_level
 * 
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":610
 *                     end_of_array = end_of_item = True
 * 
 *             elif ptr[0] == typdelim:             # <<<<<<<<<<<<<<
 *                 # Array element delimiter,
 *                 end_of_item = True
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":616
 *                     item_level = nest_level
 * 
 *             elif apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *                 if not strip_spaces:
 *                     item_ptr[0] = ptr[0]
*/
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 616, __pyx_L1_error)
      if (__pyx_t_1) {

        /* "asyncpg/protocol/codecs/array.pyx":617
 * 
 *             elif apg_ascii_isspace(ptr[0]):
 *                 if not strip_spaces:             # <<<<<<<<<<<<<<
 *                     item_ptr[0] = ptr[0]
 *                     item_ptr += 1
*/
        __pyx_t_1 = (!__pyx_v_strip_spaces);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/codecs/array.pyx":618
 *             elif apg_ascii_isspace(ptr[0]):
 *                 if not strip_spaces:
 *                     item_ptr[0] = ptr[0]             # <<<<<<<<<<<<<<
 *                     item_ptr += 1
 *                 # Ignore the leading literal whitespace.
*/
          (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]);

          /* "asyncpg/protocol/codecs/array.pyx":619
 *                 if not strip_spaces:
 *                     item_ptr[0] = ptr[0]
 *                     item_ptr += 1             # <<<<<<<<<<<<<<
 *                 # Ignore the leading literal whitespace.
 * 
*/
          __pyx_v_item_ptr = (__pyx_v_item_ptr + 1);

          /* "asyncpg/protocol/codecs/array.pyx":617
 * 
 *             elif apg_ascii_isspace(ptr[0]):
 *                 if not strip_spaces:             # <<<<<<<<<<<<<<
 *                     item_ptr[0] = ptr[0]
 *                     item_ptr += 1
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":616
 *                     item_level = nest_level
 * 
 *             elif apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *                 if not strip_spaces:
 *                     item_ptr[0] = ptr[0]
*/
        goto __pyx_L25;
      }

      /* "asyncpg/protocol/codecs/array.pyx":623
 * 
 *             else:
 *                 item_ptr[0] = ptr[0]             # <<<<<<<<<<<<<<
 *                 item_ptr += 1
 *                 strip_spaces = False
*/
      /*else*/ {
        (__pyx_v_item_ptr[0]) = (__pyx_v_ptr[0]);

        /* "asyncpg/protocol/codecs/array.pyx":624
 *             else:
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1             # <<<<<<<<<<<<<<
 *                 strip_spaces = False
 *                 item_end = item_ptr
*/
        __pyx_v_item_ptr = (__pyx_v_item_ptr + 1);

        /* "asyncpg/protocol/codecs/array.pyx":625
 *                 item_ptr[0] = ptr[0]
 *                 item_ptr += 1
 *                 strip_spaces = False             # <<<<<<<<<<<<<<
 *                 item_end = item_ptr
 * 
*/
        __pyx_v_strip_spaces = 0;

        /* "asyncpg/protocol/codecs/array.pyx":626
 *                 item_ptr += 1
 *                 strip_spaces = False
 *                 item_end = item_ptr             # <<<<<<<<<<<<<<
 * 
 *             ptr += 1
*/
        __pyx_v_item_end = __pyx_v_item_ptr;
      }
      __pyx_L25:;

      /* "asyncpg/protocol/codecs/array.pyx":628
 *                 item_end = item_ptr
 * 
 *             ptr += 1             # <<<<<<<<<<<<<<
 * 
 *         # end while not end_of_item
*/
      __pyx_v_ptr = (__pyx_v_ptr + 1);
    }

    /* "asyncpg/protocol/codecs/array.pyx":632
 *         # end while not end_of_item
 * 
 *         if item_end == item_start:             # <<<<<<<<<<<<<<
 *             # Empty array
 *             continue
*/
    __pyx_t_1 = (__pyx_v_item_end == __pyx_v_item_start);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/array.pyx":634
 *         if item_end == item_start:
 *             # Empty array
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         item_end[0] = '\0'
*/
      goto __pyx_L21_continue;

      /* "asyncpg/protocol/codecs/array.pyx":632
 *         # end while not end_of_item
 * 
 *         if item_end == item_start:             # <<<<<<<<<<<<<<
 *             # Empty array
 *             continue
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":636
 *             continue
 * 
 *         item_end[0] = '\0'             # <<<<<<<<<<<<<<
 * 
 *         if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0:
*/
    (__pyx_v_item_end[0]) = 0;

    /* "asyncpg/protocol/codecs/array.pyx":638
 *         item_end[0] = '\0'
 * 
 *         if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0:             # <<<<<<<<<<<<<<
 *             # NULL element.
 *             item = None
*/
    __pyx_t_13 = (!__pyx_v_has_quoting);
    if (__pyx_t_13) {
    } else {
      __pyx_t_1 = __pyx_t_13;
      goto __pyx_L34_bool_binop_done;
    }
    __pyx_t_11 = __pyx_f_7asyncpg_8protocol_8protocol_apg_strcasecmp(__pyx_v_item_start, __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 638, __pyx_L1_error)
    __pyx_t_13 = (__pyx_t_11 == 0);
    __pyx_t_1 = __pyx_t_13;
    __pyx_L34_bool_binop_done:;
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/array.pyx":640
 *         if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0:
 *             # NULL element.
 *             item = None             # <<<<<<<<<<<<<<
 *         else:
 *             # XXX: find a way to avoid the redundant encode/decode
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_item, Py_None);

      /* "asyncpg/protocol/codecs/array.pyx":638
 *         item_end[0] = '\0'
 * 
 *         if not has_quoting and apg_strcasecmp(item_start, APG_NULL) == 0:             # <<<<<<<<<<<<<<
 *             # NULL element.
 *             item = None
*/
      goto __pyx_L33;
    }

    /* "asyncpg/protocol/codecs/array.pyx":644
 *             # XXX: find a way to avoid the redundant encode/decode
 *             # cycle here.
 *             item_text = cpythonx.PyUnicode_FromKindAndData(             # <<<<<<<<<<<<<<
 *                 cpythonx.PyUnicode_4BYTE_KIND,
 *                 <void *>item_start,
*/
    /*else*/ {

      /* "asyncpg/protocol/codecs/array.pyx":647
 *                 cpythonx.PyUnicode_4BYTE_KIND,
 *                 <void *>item_start,
 *                 item_end - item_start)             # <<<<<<<<<<<<<<
 * 
 *             # Prepare the element buffer and call the text decoder
*/
      __pyx_t_2 = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, ((void *)__pyx_v_item_start), (__pyx_v_item_end - __pyx_v_item_start)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "asyncpg/protocol/codecs/array.pyx":644
 *             # XXX: find a way to avoid the redundant encode/decode
 *             # cycle here.
 *             item_text = cpythonx.PyUnicode_FromKindAndData(             # <<<<<<<<<<<<<<
 *                 cpythonx.PyUnicode_4BYTE_KIND,
 *                 <void *>item_start,
*/
      if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(2, 644, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_item_text, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":651
 *             # Prepare the element buffer and call the text decoder
 *             # for the element type.
 *             pgproto.as_pg_string_and_size(             # <<<<<<<<<<<<<<
 *                 settings, item_text, &pg_item_str, &pg_item_len)
 *             frb_init(&item_buf, pg_item_str, pg_item_len)
*/
      __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_item_text, (&__pyx_v_pg_item_str), (&__pyx_v_pg_item_len)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/array.pyx":653
 *             pgproto.as_pg_string_and_size(
 *                 settings, item_text, &pg_item_str, &pg_item_len)
 *             frb_init(&item_buf, pg_item_str, pg_item_len)             # <<<<<<<<<<<<<<
 *             item = decoder(settings, &item_buf, decoder_arg)
 * 
*/
      __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init((&__pyx_v_item_buf), __pyx_v_pg_item_str, __pyx_v_pg_item_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 653, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":654
 *                 settings, item_text, &pg_item_str, &pg_item_len)
 *             frb_init(&item_buf, pg_item_str, pg_item_len)
 *             item = decoder(settings, &item_buf, decoder_arg)             # <<<<<<<<<<<<<<
 * 
 *         # Place the decoded element in the array.
*/
      __pyx_t_2 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_item_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L33:;

    /* "asyncpg/protocol/codecs/array.pyx":657
 * 
 *         # Place the decoded element in the array.
 *         cpython.Py_INCREF(item)             # <<<<<<<<<<<<<<
 *         cpython.PyList_SET_ITEM(
 *             <object><cpython.PyObject*>strides[item_level - 1],
*/
    Py_INCREF(__pyx_v_item);

    /* "asyncpg/protocol/codecs/array.pyx":659
 *         cpython.Py_INCREF(item)
 *         cpython.PyList_SET_ITEM(
 *             <object><cpython.PyObject*>strides[item_level - 1],             # <<<<<<<<<<<<<<
 *             indexes[item_level - 1],
 *             item)
*/
    __pyx_t_12 = ((PyObject *)(__pyx_v_strides[(__pyx_v_item_level - 1)]));

    /* "asyncpg/protocol/codecs/array.pyx":658
 *         # Place the decoded element in the array.
 *         cpython.Py_INCREF(item)
 *         cpython.PyList_SET_ITEM(             # <<<<<<<<<<<<<<
 *             <object><cpython.PyObject*>strides[item_level - 1],
 *             indexes[item_level - 1],
*/
    PyList_SET_ITEM(((PyObject *)__pyx_t_12), (__pyx_v_indexes[(__pyx_v_item_level - 1)]), __pyx_v_item);

    /* "asyncpg/protocol/codecs/array.pyx":663
 *             item)
 * 
 *         if nest_level > 0:             # <<<<<<<<<<<<<<
 *             indexes[nest_level - 1] += 1
 * 
*/
    __pyx_t_1 = (__pyx_v_nest_level > 0);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/codecs/array.pyx":664
 * 
 *         if nest_level > 0:
 *             indexes[nest_level - 1] += 1             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
      __pyx_t_14 = (__pyx_v_nest_level - 1);
      (__pyx_v_indexes[__pyx_t_14]) = ((__pyx_v_indexes[__pyx_t_14]) + 1);

      /* "asyncpg/protocol/codecs/array.pyx":663
 *             item)
 * 
 *         if nest_level > 0:             # <<<<<<<<<<<<<<
 *             indexes[nest_level - 1] += 1
 * 
*/
    }
    __pyx_L21_continue:;
  }

  /* "asyncpg/protocol/codecs/array.pyx":666
 *             indexes[nest_level - 1] += 1
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); __PYX_ERR(2, 666, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":435
 * 
 * 
 * cdef _textarray_decode(ConnectionSettings settings,             # <<<<<<<<<<<<<<
 *                        Py_UCS4 *array_text,
 *                        decode_func_ex decoder,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._textarray_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_new_stride);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_item_text);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":678
 * 
 * 
 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr):             # <<<<<<<<<<<<<<
 *     return ValueError('unexpected character {!r} at position {}'.format(
 *         cpython.PyUnicode_FromOrdinal(<int>ptr[0]), ptr - array_text + 1))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(Py_UCS4 const *__pyx_v_array_text, Py_UCS4 const *__pyx_v_ptr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_UnexpectedCharacter", 0);

  /* "asyncpg/protocol/codecs/array.pyx":679
 * 
 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr):
 *     return ValueError('unexpected character {!r} at position {}'.format(             # <<<<<<<<<<<<<<
 *         cpython.PyUnicode_FromOrdinal(<int>ptr[0]), ptr - array_text + 1))
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_unexpected_character_r_at_positi;
  __Pyx_INCREF(__pyx_t_4);

  /* "asyncpg/protocol/codecs/array.pyx":680
 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr):
 *     return ValueError('unexpected character {!r} at position {}'.format(
 *         cpython.PyUnicode_FromOrdinal(<int>ptr[0]), ptr - array_text + 1))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = PyUnicode_FromOrdinal(((int)(__pyx_v_ptr[0]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":678
 * 
 * 
 * cdef _UnexpectedCharacter(const Py_UCS4 *array_text, const Py_UCS4 *ptr):             # <<<<<<<<<<<<<<
 *     return ValueError('unexpected character {!r} at position {}'.format(
 *         cpython.PyUnicode_FromOrdinal(<int>ptr[0]), ptr - array_text + 1))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._UnexpectedCharacter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":683
 * 
 * 
 * cdef _infer_array_dims(const Py_UCS4 *array_text,             # <<<<<<<<<<<<<<
 *                        Py_UCS4 typdelim,
 *                        int32_t *dims,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__infer_array_dims(Py_UCS4 const *__pyx_v_array_text, Py_UCS4 __pyx_v_typdelim, int32_t *__pyx_v_dims, int32_t *__pyx_v_ndims) {
  Py_UCS4 const *__pyx_v_ptr;
  int __pyx_v_i;
  int __pyx_v_nest_level;
  int __pyx_v_end_of_array;
  int __pyx_v_end_of_item;
  int __pyx_v_in_quotes;
  int __pyx_v_array_is_empty;
  int __pyx_v_stride_len[6];
  int __pyx_v_prev_stride_len[6];
  enum __pyx_t_7asyncpg_8protocol_8protocol__ArrayParseState __pyx_v_parse_state;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_infer_array_dims", 0);

  /* "asyncpg/protocol/codecs/array.pyx":688
 *                        int32_t *ndims):
 *     cdef:
 *         const Py_UCS4 *ptr = array_text             # <<<<<<<<<<<<<<
 *         int i
 *         int nest_level = 0
*/
  __pyx_v_ptr = __pyx_v_array_text;

  /* "asyncpg/protocol/codecs/array.pyx":690
 *         const Py_UCS4 *ptr = array_text
 *         int i
 *         int nest_level = 0             # <<<<<<<<<<<<<<
 *         bint end_of_array = False
 *         bint end_of_item = False
*/
  __pyx_v_nest_level = 0;

  /* "asyncpg/protocol/codecs/array.pyx":691
 *         int i
 *         int nest_level = 0
 *         bint end_of_array = False             # <<<<<<<<<<<<<<
 *         bint end_of_item = False
 *         bint in_quotes = False
*/
  __pyx_v_end_of_array = 0;

  /* "asyncpg/protocol/codecs/array.pyx":692
 *         int nest_level = 0
 *         bint end_of_array = False
 *         bint end_of_item = False             # <<<<<<<<<<<<<<
 *         bint in_quotes = False
 *         bint array_is_empty = True
*/
  __pyx_v_end_of_item = 0;

  /* "asyncpg/protocol/codecs/array.pyx":693
 *         bint end_of_array = False
 *         bint end_of_item = False
 *         bint in_quotes = False             # <<<<<<<<<<<<<<
 *         bint array_is_empty = True
 *         int stride_len[ARRAY_MAXDIM]
*/
  __pyx_v_in_quotes = 0;

  /* "asyncpg/protocol/codecs/array.pyx":694
 *         bint end_of_item = False
 *         bint in_quotes = False
 *         bint array_is_empty = True             # <<<<<<<<<<<<<<
 *         int stride_len[ARRAY_MAXDIM]
 *         int prev_stride_len[ARRAY_MAXDIM]
*/
  __pyx_v_array_is_empty = 1;

  /* "asyncpg/protocol/codecs/array.pyx":697
 *         int stride_len[ARRAY_MAXDIM]
 *         int prev_stride_len[ARRAY_MAXDIM]
 *         _ArrayParseState parse_state = APS_START             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ARRAY_MAXDIM):
*/
  __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_START;

  /* "asyncpg/protocol/codecs/array.pyx":699
 *         _ArrayParseState parse_state = APS_START
 * 
 *     for i in range(ARRAY_MAXDIM):             # <<<<<<<<<<<<<<
 *         dims[i] = prev_stride_len[i] = 0
 *         stride_len[i] = 1
*/
  for (__pyx_t_1 = 0; __pyx_t_1 < 6; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "asyncpg/protocol/codecs/array.pyx":700
 * 
 *     for i in range(ARRAY_MAXDIM):
 *         dims[i] = prev_stride_len[i] = 0             # <<<<<<<<<<<<<<
 *         stride_len[i] = 1
 * 
*/
    (__pyx_v_dims[__pyx_v_i]) = 0;
    (__pyx_v_prev_stride_len[__pyx_v_i]) = 0;

    /* "asyncpg/protocol/codecs/array.pyx":701
 *     for i in range(ARRAY_MAXDIM):
 *         dims[i] = prev_stride_len[i] = 0
 *         stride_len[i] = 1             # <<<<<<<<<<<<<<
 * 
 *     while not end_of_array:
*/
    (__pyx_v_stride_len[__pyx_v_i]) = 1;
  }

  /* "asyncpg/protocol/codecs/array.pyx":703
 *         stride_len[i] = 1
 * 
 *     while not end_of_array:             # <<<<<<<<<<<<<<
 *         end_of_item = False
 * 
*/
  while (1) {
    __pyx_t_2 = (!__pyx_v_end_of_array);
    if (!__pyx_t_2) break;

    /* "asyncpg/protocol/codecs/array.pyx":704
 * 
 *     while not end_of_array:
 *         end_of_item = False             # <<<<<<<<<<<<<<
 * 
 *         while not end_of_item:
*/
    __pyx_v_end_of_item = 0;

    /* "asyncpg/protocol/codecs/array.pyx":706
 *         end_of_item = False
 * 
 *         while not end_of_item:             # <<<<<<<<<<<<<<
 *             if ptr[0] == '\0':
 *                 raise ValueError('unexpected end of string')
*/
    while (1) {
      __pyx_t_2 = (!__pyx_v_end_of_item);
      if (!__pyx_t_2) break;

      /* "asyncpg/protocol/codecs/array.pyx":707
 * 
 *         while not end_of_item:
 *             if ptr[0] == '\0':             # <<<<<<<<<<<<<<
 *                 raise ValueError('unexpected end of string')
 * 
*/
      __pyx_t_2 = ((__pyx_v_ptr[0]) == 0);
      if (unlikely(__pyx_t_2)) {

        /* "asyncpg/protocol/codecs/array.pyx":708
 *         while not end_of_item:
 *             if ptr[0] == '\0':
 *                 raise ValueError('unexpected end of string')             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '"':
*/
        __pyx_t_4 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_unexpected_end_of_string};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 708, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(2, 708, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/array.pyx":707
 * 
 *         while not end_of_item:
 *             if ptr[0] == '\0':             # <<<<<<<<<<<<<<
 *                 raise ValueError('unexpected end of string')
 * 
*/
      }

      /* "asyncpg/protocol/codecs/array.pyx":710
 *                 raise ValueError('unexpected end of string')
 * 
 *             elif ptr[0] == '"':             # <<<<<<<<<<<<<<
 *                 if (parse_state not in (APS_STRIDE_STARTED,
 *                                         APS_ELEM_DELIMITED) and
*/
      __pyx_t_2 = ((__pyx_v_ptr[0]) == 34);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":711
 * 
 *             elif ptr[0] == '"':
 *                 if (parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED:

          /* "asyncpg/protocol/codecs/array.pyx":712
 *             elif ptr[0] == '"':
 *                 if (parse_state not in (APS_STRIDE_STARTED,
 *                                         APS_ELEM_DELIMITED) and             # <<<<<<<<<<<<<<
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
          __pyx_t_6 = 0;

          /* "asyncpg/protocol/codecs/array.pyx":711
 * 
 *             elif ptr[0] == '"':
 *                 if (parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
*/
          break;
          default:
          __pyx_t_6 = 1;
          break;
        }
        __pyx_t_7 = __pyx_t_6;
        if (__pyx_t_7) {
        } else {
          __pyx_t_2 = __pyx_t_7;
          goto __pyx_L11_bool_binop_done;
        }

        /* "asyncpg/protocol/codecs/array.pyx":713
 *                 if (parse_state not in (APS_STRIDE_STARTED,
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        __pyx_t_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED);
        if (__pyx_t_6) {
        } else {
          __pyx_t_7 = __pyx_t_6;
          goto __pyx_L13_bool_binop_done;
        }
        __pyx_t_7 = __pyx_v_in_quotes;
        __pyx_L13_bool_binop_done:;
        __pyx_t_6 = (!__pyx_t_7);
        __pyx_t_2 = __pyx_t_6;
        __pyx_L11_bool_binop_done:;

        /* "asyncpg/protocol/codecs/array.pyx":711
 * 
 *             elif ptr[0] == '"':
 *                 if (parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
*/
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":714
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 in_quotes = not in_quotes
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 714, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":711
 * 
 *             elif ptr[0] == '"':
 *                 if (parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                         APS_ELEM_DELIMITED) and
 *                         not (parse_state == APS_ELEM_STARTED and in_quotes)):
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":716
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 in_quotes = not in_quotes             # <<<<<<<<<<<<<<
 *                 if in_quotes:
 *                     parse_state = APS_ELEM_STARTED
*/
        __pyx_v_in_quotes = (!__pyx_v_in_quotes);

        /* "asyncpg/protocol/codecs/array.pyx":717
 * 
 *                 in_quotes = not in_quotes
 *                 if in_quotes:             # <<<<<<<<<<<<<<
 *                     parse_state = APS_ELEM_STARTED
 *                     array_is_empty = False
*/
        if (__pyx_v_in_quotes) {

          /* "asyncpg/protocol/codecs/array.pyx":718
 *                 in_quotes = not in_quotes
 *                 if in_quotes:
 *                     parse_state = APS_ELEM_STARTED             # <<<<<<<<<<<<<<
 *                     array_is_empty = False
 * 
*/
          __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED;

          /* "asyncpg/protocol/codecs/array.pyx":719
 *                 if in_quotes:
 *                     parse_state = APS_ELEM_STARTED
 *                     array_is_empty = False             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '\\':
*/
          __pyx_v_array_is_empty = 0;

          /* "asyncpg/protocol/codecs/array.pyx":717
 * 
 *                 in_quotes = not in_quotes
 *                 if in_quotes:             # <<<<<<<<<<<<<<
 *                     parse_state = APS_ELEM_STARTED
 *                     array_is_empty = False
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":710
 *                 raise ValueError('unexpected end of string')
 * 
 *             elif ptr[0] == '"':             # <<<<<<<<<<<<<<
 *                 if (parse_state not in (APS_STRIDE_STARTED,
 *                                         APS_ELEM_DELIMITED) and
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":721
 *                     array_is_empty = False
 * 
 *             elif ptr[0] == '\\':             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,
*/
      __pyx_t_2 = ((__pyx_v_ptr[0]) == 92);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":722
 * 
 *             elif ptr[0] == '\\':
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED:

          /* "asyncpg/protocol/codecs/array.pyx":723
 *             elif ptr[0] == '\\':
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED:

          /* "asyncpg/protocol/codecs/array.pyx":722
 * 
 *             elif ptr[0] == '\\':
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
          __pyx_t_2 = 0;
          break;
          default:
          __pyx_t_2 = 1;
          break;
        }
        __pyx_t_6 = __pyx_t_2;
        if (unlikely(__pyx_t_6)) {

          /* "asyncpg/protocol/codecs/array.pyx":725
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 parse_state = APS_ELEM_STARTED
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 725, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 725, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":722
 * 
 *             elif ptr[0] == '\\':
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":727
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 parse_state = APS_ELEM_STARTED             # <<<<<<<<<<<<<<
 *                 array_is_empty = False
 * 
*/
        __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED;

        /* "asyncpg/protocol/codecs/array.pyx":728
 * 
 *                 parse_state = APS_ELEM_STARTED
 *                 array_is_empty = False             # <<<<<<<<<<<<<<
 * 
 *                 if ptr[1] != '\0':
*/
        __pyx_v_array_is_empty = 0;

        /* "asyncpg/protocol/codecs/array.pyx":730
 *                 array_is_empty = False
 * 
 *                 if ptr[1] != '\0':             # <<<<<<<<<<<<<<
 *                     ptr += 1
 *                 else:
*/
        __pyx_t_6 = ((__pyx_v_ptr[1]) != 0);
        if (likely(__pyx_t_6)) {

          /* "asyncpg/protocol/codecs/array.pyx":731
 * 
 *                 if ptr[1] != '\0':
 *                     ptr += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError('unexpected end of string')
*/
          __pyx_v_ptr = (__pyx_v_ptr + 1);

          /* "asyncpg/protocol/codecs/array.pyx":730
 *                 array_is_empty = False
 * 
 *                 if ptr[1] != '\0':             # <<<<<<<<<<<<<<
 *                     ptr += 1
 *                 else:
*/
          goto __pyx_L17;
        }

        /* "asyncpg/protocol/codecs/array.pyx":733
 *                     ptr += 1
 *                 else:
 *                     raise ValueError('unexpected end of string')             # <<<<<<<<<<<<<<
 * 
 *             elif in_quotes:
*/
        /*else*/ {
          __pyx_t_4 = NULL;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_unexpected_end_of_string};
            __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 733, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 733, __pyx_L1_error)
        }
        __pyx_L17:;

        /* "asyncpg/protocol/codecs/array.pyx":721
 *                     array_is_empty = False
 * 
 *             elif ptr[0] == '\\':             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":735
 *                     raise ValueError('unexpected end of string')
 * 
 *             elif in_quotes:             # <<<<<<<<<<<<<<
 *                 # Ignore everything inside the quotes.
 *                 pass
*/
      if (__pyx_v_in_quotes) {
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":739
 *                 pass
 * 
 *             elif ptr[0] == '{':             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_START,
 *                                        APS_STRIDE_STARTED,
*/
      __pyx_t_6 = ((__pyx_v_ptr[0]) == 0x7B);
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/array.pyx":740
 * 
 *             elif ptr[0] == '{':
 *                 if parse_state not in (APS_START,             # <<<<<<<<<<<<<<
 *                                        APS_STRIDE_STARTED,
 *                                        APS_STRIDE_DELIMITED):
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_START:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED:

          /* "asyncpg/protocol/codecs/array.pyx":741
 *             elif ptr[0] == '{':
 *                 if parse_state not in (APS_START,
 *                                        APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_STRIDE_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED:

          /* "asyncpg/protocol/codecs/array.pyx":740
 * 
 *             elif ptr[0] == '{':
 *                 if parse_state not in (APS_START,             # <<<<<<<<<<<<<<
 *                                        APS_STRIDE_STARTED,
 *                                        APS_STRIDE_DELIMITED):
*/
          __pyx_t_6 = 0;
          break;
          default:
          __pyx_t_6 = 1;
          break;
        }
        __pyx_t_2 = __pyx_t_6;
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":743
 *                                        APS_STRIDE_STARTED,
 *                                        APS_STRIDE_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 parse_state = APS_STRIDE_STARTED
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 743, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 743, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":740
 * 
 *             elif ptr[0] == '{':
 *                 if parse_state not in (APS_START,             # <<<<<<<<<<<<<<
 *                                        APS_STRIDE_STARTED,
 *                                        APS_STRIDE_DELIMITED):
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":745
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 parse_state = APS_STRIDE_STARTED             # <<<<<<<<<<<<<<
 *                 if nest_level >= ARRAY_MAXDIM:
 *                     raise ValueError(
*/
        __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED;

        /* "asyncpg/protocol/codecs/array.pyx":746
 * 
 *                 parse_state = APS_STRIDE_STARTED
 *                 if nest_level >= ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'number of array dimensions ({}) exceed the '
*/
        __pyx_t_2 = (__pyx_v_nest_level >= 6);
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":747
 *                 parse_state = APS_STRIDE_STARTED
 *                 if nest_level >= ARRAY_MAXDIM:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'number of array dimensions ({}) exceed the '
 *                         'maximum expected ({})'.format(
*/
          __pyx_t_4 = NULL;

          /* "asyncpg/protocol/codecs/array.pyx":749
 *                     raise ValueError(
 *                         'number of array dimensions ({}) exceed the '
 *                         'maximum expected ({})'.format(             # <<<<<<<<<<<<<<
 *                             nest_level, ARRAY_MAXDIM))
 * 
*/
          __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_number_of_array_dimensions_excee;
          __Pyx_INCREF(__pyx_t_9);

          /* "asyncpg/protocol/codecs/array.pyx":750
 *                         'number of array dimensions ({}) exceed the '
 *                         'maximum expected ({})'.format(
 *                             nest_level, ARRAY_MAXDIM))             # <<<<<<<<<<<<<<
 * 
 *                 dims[nest_level] = 0
*/
          __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_nest_level); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_mstate_global->__pyx_int_6};
            __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 749, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
            __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 747, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 747, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":746
 * 
 *                 parse_state = APS_STRIDE_STARTED
 *                 if nest_level >= ARRAY_MAXDIM:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'number of array dimensions ({}) exceed the '
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":752
 *                             nest_level, ARRAY_MAXDIM))
 * 
 *                 dims[nest_level] = 0             # <<<<<<<<<<<<<<
 *                 nest_level += 1
 *                 if ndims[0] < nest_level:
*/
        (__pyx_v_dims[__pyx_v_nest_level]) = 0;

        /* "asyncpg/protocol/codecs/array.pyx":753
 * 
 *                 dims[nest_level] = 0
 *                 nest_level += 1             # <<<<<<<<<<<<<<
 *                 if ndims[0] < nest_level:
 *                     ndims[0] = nest_level
*/
        __pyx_v_nest_level = (__pyx_v_nest_level + 1);

        /* "asyncpg/protocol/codecs/array.pyx":754
 *                 dims[nest_level] = 0
 *                 nest_level += 1
 *                 if ndims[0] < nest_level:             # <<<<<<<<<<<<<<
 *                     ndims[0] = nest_level
 * 
*/
        __pyx_t_2 = ((__pyx_v_ndims[0]) < __pyx_v_nest_level);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":755
 *                 nest_level += 1
 *                 if ndims[0] < nest_level:
 *                     ndims[0] = nest_level             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == '}':
*/
          (__pyx_v_ndims[0]) = __pyx_v_nest_level;

          /* "asyncpg/protocol/codecs/array.pyx":754
 *                 dims[nest_level] = 0
 *                 nest_level += 1
 *                 if ndims[0] < nest_level:             # <<<<<<<<<<<<<<
 *                     ndims[0] = nest_level
 * 
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":739
 *                 pass
 * 
 *             elif ptr[0] == '{':             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_START,
 *                                        APS_STRIDE_STARTED,
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":757
 *                     ndims[0] = nest_level
 * 
 *             elif ptr[0] == '}':             # <<<<<<<<<<<<<<
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and
 *                         not (nest_level == 1 and
*/
      __pyx_t_2 = ((__pyx_v_ptr[0]) == 0x7D);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":758
 * 
 *             elif ptr[0] == '}':
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and             # <<<<<<<<<<<<<<
 *                         not (nest_level == 1 and
 *                              parse_state == APS_STRIDE_STARTED)):
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE:
          __pyx_t_6 = 0;
          break;
          default:
          __pyx_t_6 = 1;
          break;
        }
        __pyx_t_7 = __pyx_t_6;
        if (__pyx_t_7) {
        } else {
          __pyx_t_2 = __pyx_t_7;
          goto __pyx_L22_bool_binop_done;
        }

        /* "asyncpg/protocol/codecs/array.pyx":759
 *             elif ptr[0] == '}':
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and
 *                         not (nest_level == 1 and             # <<<<<<<<<<<<<<
 *                              parse_state == APS_STRIDE_STARTED)):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
        __pyx_t_6 = (__pyx_v_nest_level == 1);
        if (__pyx_t_6) {
        } else {
          __pyx_t_7 = __pyx_t_6;
          goto __pyx_L24_bool_binop_done;
        }

        /* "asyncpg/protocol/codecs/array.pyx":760
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and
 *                         not (nest_level == 1 and
 *                              parse_state == APS_STRIDE_STARTED)):             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        __pyx_t_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED);
        __pyx_t_7 = __pyx_t_6;
        __pyx_L24_bool_binop_done:;

        /* "asyncpg/protocol/codecs/array.pyx":759
 *             elif ptr[0] == '}':
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and
 *                         not (nest_level == 1 and             # <<<<<<<<<<<<<<
 *                              parse_state == APS_STRIDE_STARTED)):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
        __pyx_t_6 = (!__pyx_t_7);
        __pyx_t_2 = __pyx_t_6;
        __pyx_L22_bool_binop_done:;

        /* "asyncpg/protocol/codecs/array.pyx":758
 * 
 *             elif ptr[0] == '}':
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and             # <<<<<<<<<<<<<<
 *                         not (nest_level == 1 and
 *                              parse_state == APS_STRIDE_STARTED)):
*/
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":761
 *                         not (nest_level == 1 and
 *                              parse_state == APS_STRIDE_STARTED)):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 parse_state = APS_STRIDE_DONE
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 761, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 761, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":758
 * 
 *             elif ptr[0] == '}':
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and             # <<<<<<<<<<<<<<
 *                         not (nest_level == 1 and
 *                              parse_state == APS_STRIDE_STARTED)):
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":763
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 parse_state = APS_STRIDE_DONE             # <<<<<<<<<<<<<<
 * 
 *                 if nest_level == 0:
*/
        __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE;

        /* "asyncpg/protocol/codecs/array.pyx":765
 *                 parse_state = APS_STRIDE_DONE
 * 
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        __pyx_t_2 = (__pyx_v_nest_level == 0);
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":766
 * 
 *                 if nest_level == 0:
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 nest_level -= 1
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 766, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 766, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":765
 *                 parse_state = APS_STRIDE_DONE
 * 
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":768
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 nest_level -= 1             # <<<<<<<<<<<<<<
 * 
 *                 if (prev_stride_len[nest_level] != 0 and
*/
        __pyx_v_nest_level = (__pyx_v_nest_level - 1);

        /* "asyncpg/protocol/codecs/array.pyx":770
 *                 nest_level -= 1
 * 
 *                 if (prev_stride_len[nest_level] != 0 and             # <<<<<<<<<<<<<<
 *                         stride_len[nest_level] != prev_stride_len[nest_level]):
 *                     raise ValueError(
*/
        __pyx_t_6 = ((__pyx_v_prev_stride_len[__pyx_v_nest_level]) != 0);
        if (__pyx_t_6) {
        } else {
          __pyx_t_2 = __pyx_t_6;
          goto __pyx_L28_bool_binop_done;
        }

        /* "asyncpg/protocol/codecs/array.pyx":771
 * 
 *                 if (prev_stride_len[nest_level] != 0 and
 *                         stride_len[nest_level] != prev_stride_len[nest_level]):             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'inconsistent sub-array dimensions'
*/
        __pyx_t_6 = ((__pyx_v_stride_len[__pyx_v_nest_level]) != (__pyx_v_prev_stride_len[__pyx_v_nest_level]));
        __pyx_t_2 = __pyx_t_6;
        __pyx_L28_bool_binop_done:;

        /* "asyncpg/protocol/codecs/array.pyx":770
 *                 nest_level -= 1
 * 
 *                 if (prev_stride_len[nest_level] != 0 and             # <<<<<<<<<<<<<<
 *                         stride_len[nest_level] != prev_stride_len[nest_level]):
 *                     raise ValueError(
*/
        if (unlikely(__pyx_t_2)) {

          /* "asyncpg/protocol/codecs/array.pyx":772
 *                 if (prev_stride_len[nest_level] != 0 and
 *                         stride_len[nest_level] != prev_stride_len[nest_level]):
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'inconsistent sub-array dimensions'
 *                         ' at position {}'.format(
*/
          __pyx_t_8 = NULL;

          /* "asyncpg/protocol/codecs/array.pyx":774
 *                     raise ValueError(
 *                         'inconsistent sub-array dimensions'
 *                         ' at position {}'.format(             # <<<<<<<<<<<<<<
 *                             ptr - array_text + 1))
 * 
*/
          __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u_inconsistent_sub_array_dimension;
          __Pyx_INCREF(__pyx_t_10);

          /* "asyncpg/protocol/codecs/array.pyx":775
 *                         'inconsistent sub-array dimensions'
 *                         ' at position {}'.format(
 *                             ptr - array_text + 1))             # <<<<<<<<<<<<<<
 * 
 *                 prev_stride_len[nest_level] = stride_len[nest_level]
*/
          __pyx_t_9 = __Pyx_PyLong_From_ptrdiff_t(((__pyx_v_ptr - __pyx_v_array_text) + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 775, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 774, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
            __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 772, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":770
 *                 nest_level -= 1
 * 
 *                 if (prev_stride_len[nest_level] != 0 and             # <<<<<<<<<<<<<<
 *                         stride_len[nest_level] != prev_stride_len[nest_level]):
 *                     raise ValueError(
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":777
 *                             ptr - array_text + 1))
 * 
 *                 prev_stride_len[nest_level] = stride_len[nest_level]             # <<<<<<<<<<<<<<
 *                 stride_len[nest_level] = 1
 *                 if nest_level == 0:
*/
        (__pyx_v_prev_stride_len[__pyx_v_nest_level]) = (__pyx_v_stride_len[__pyx_v_nest_level]);

        /* "asyncpg/protocol/codecs/array.pyx":778
 * 
 *                 prev_stride_len[nest_level] = stride_len[nest_level]
 *                 stride_len[nest_level] = 1             # <<<<<<<<<<<<<<
 *                 if nest_level == 0:
 *                     end_of_array = end_of_item = True
*/
        (__pyx_v_stride_len[__pyx_v_nest_level]) = 1;

        /* "asyncpg/protocol/codecs/array.pyx":779
 *                 prev_stride_len[nest_level] = stride_len[nest_level]
 *                 stride_len[nest_level] = 1
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     end_of_array = end_of_item = True
 *                 else:
*/
        __pyx_t_2 = (__pyx_v_nest_level == 0);
        if (__pyx_t_2) {

          /* "asyncpg/protocol/codecs/array.pyx":780
 *                 stride_len[nest_level] = 1
 *                 if nest_level == 0:
 *                     end_of_array = end_of_item = True             # <<<<<<<<<<<<<<
 *                 else:
 *                     dims[nest_level - 1] += 1
*/
          __pyx_v_end_of_array = 1;
          __pyx_v_end_of_item = 1;

          /* "asyncpg/protocol/codecs/array.pyx":779
 *                 prev_stride_len[nest_level] = stride_len[nest_level]
 *                 stride_len[nest_level] = 1
 *                 if nest_level == 0:             # <<<<<<<<<<<<<<
 *                     end_of_array = end_of_item = True
 *                 else:
*/
          goto __pyx_L30;
        }

        /* "asyncpg/protocol/codecs/array.pyx":782
 *                     end_of_array = end_of_item = True
 *                 else:
 *                     dims[nest_level - 1] += 1             # <<<<<<<<<<<<<<
 * 
 *             elif ptr[0] == typdelim:
*/
        /*else*/ {
          __pyx_t_11 = (__pyx_v_nest_level - 1);
          (__pyx_v_dims[__pyx_t_11]) = ((__pyx_v_dims[__pyx_t_11]) + 1);
        }
        __pyx_L30:;

        /* "asyncpg/protocol/codecs/array.pyx":757
 *                     ndims[0] = nest_level
 * 
 *             elif ptr[0] == '}':             # <<<<<<<<<<<<<<
 *                 if (parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE) and
 *                         not (nest_level == 1 and
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":784
 *                     dims[nest_level - 1] += 1
 * 
 *             elif ptr[0] == typdelim:             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
      __pyx_t_2 = ((__pyx_v_ptr[0]) == __pyx_v_typdelim);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":785
 * 
 *             elif ptr[0] == typdelim:
 *                 if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE):             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE:
          __pyx_t_2 = 0;
          break;
          default:
          __pyx_t_2 = 1;
          break;
        }
        __pyx_t_6 = __pyx_t_2;
        if (unlikely(__pyx_t_6)) {

          /* "asyncpg/protocol/codecs/array.pyx":786
 *             elif ptr[0] == typdelim:
 *                 if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 if parse_state == APS_STRIDE_DONE:
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 786, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 786, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":785
 * 
 *             elif ptr[0] == typdelim:
 *                 if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE):             # <<<<<<<<<<<<<<
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":788
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 if parse_state == APS_STRIDE_DONE:             # <<<<<<<<<<<<<<
 *                     parse_state = APS_STRIDE_DELIMITED
 *                 else:
*/
        __pyx_t_6 = (__pyx_v_parse_state == __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DONE);
        if (__pyx_t_6) {

          /* "asyncpg/protocol/codecs/array.pyx":789
 * 
 *                 if parse_state == APS_STRIDE_DONE:
 *                     parse_state = APS_STRIDE_DELIMITED             # <<<<<<<<<<<<<<
 *                 else:
 *                     parse_state = APS_ELEM_DELIMITED
*/
          __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_DELIMITED;

          /* "asyncpg/protocol/codecs/array.pyx":788
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 if parse_state == APS_STRIDE_DONE:             # <<<<<<<<<<<<<<
 *                     parse_state = APS_STRIDE_DELIMITED
 *                 else:
*/
          goto __pyx_L32;
        }

        /* "asyncpg/protocol/codecs/array.pyx":791
 *                     parse_state = APS_STRIDE_DELIMITED
 *                 else:
 *                     parse_state = APS_ELEM_DELIMITED             # <<<<<<<<<<<<<<
 *                 end_of_item = True
 *                 stride_len[nest_level - 1] += 1
*/
        /*else*/ {
          __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED;
        }
        __pyx_L32:;

        /* "asyncpg/protocol/codecs/array.pyx":792
 *                 else:
 *                     parse_state = APS_ELEM_DELIMITED
 *                 end_of_item = True             # <<<<<<<<<<<<<<
 *                 stride_len[nest_level - 1] += 1
 * 
*/
        __pyx_v_end_of_item = 1;

        /* "asyncpg/protocol/codecs/array.pyx":793
 *                     parse_state = APS_ELEM_DELIMITED
 *                 end_of_item = True
 *                 stride_len[nest_level - 1] += 1             # <<<<<<<<<<<<<<
 * 
 *             elif not apg_ascii_isspace(ptr[0]):
*/
        __pyx_t_11 = (__pyx_v_nest_level - 1);
        (__pyx_v_stride_len[__pyx_t_11]) = ((__pyx_v_stride_len[__pyx_t_11]) + 1);

        /* "asyncpg/protocol/codecs/array.pyx":784
 *                     dims[nest_level - 1] += 1
 * 
 *             elif ptr[0] == typdelim:             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_ELEM_STARTED, APS_STRIDE_DONE):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
        goto __pyx_L9;
      }

      /* "asyncpg/protocol/codecs/array.pyx":795
 *                 stride_len[nest_level - 1] += 1
 * 
 *             elif not apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,
*/
      __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 795, __pyx_L1_error)
      __pyx_t_2 = (!__pyx_t_6);
      if (__pyx_t_2) {

        /* "asyncpg/protocol/codecs/array.pyx":796
 * 
 *             elif not apg_ascii_isspace(ptr[0]):
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
        switch (__pyx_v_parse_state) {
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_STRIDE_STARTED:
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED:

          /* "asyncpg/protocol/codecs/array.pyx":797
 *             elif not apg_ascii_isspace(ptr[0]):
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)
*/
          case __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_DELIMITED:

          /* "asyncpg/protocol/codecs/array.pyx":796
 * 
 *             elif not apg_ascii_isspace(ptr[0]):
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
          __pyx_t_2 = 0;
          break;
          default:
          __pyx_t_2 = 1;
          break;
        }
        __pyx_t_6 = __pyx_t_2;
        if (unlikely(__pyx_t_6)) {

          /* "asyncpg/protocol/codecs/array.pyx":799
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
 *                     raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *                 parse_state = APS_ELEM_STARTED
*/
          __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 799, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __PYX_ERR(2, 799, __pyx_L1_error)

          /* "asyncpg/protocol/codecs/array.pyx":796
 * 
 *             elif not apg_ascii_isspace(ptr[0]):
 *                 if parse_state not in (APS_STRIDE_STARTED,             # <<<<<<<<<<<<<<
 *                                        APS_ELEM_STARTED,
 *                                        APS_ELEM_DELIMITED):
*/
        }

        /* "asyncpg/protocol/codecs/array.pyx":801
 *                     raise _UnexpectedCharacter(array_text, ptr)
 * 
 *                 parse_state = APS_ELEM_STARTED             # <<<<<<<<<<<<<<
 *                 array_is_empty = False
 * 
*/
        __pyx_v_parse_state = __pyx_e_7asyncpg_8protocol_8protocol_APS_ELEM_STARTED;

        /* "asyncpg/protocol/codecs/array.pyx":802
 * 
 *                 parse_state = APS_ELEM_STARTED
 *                 array_is_empty = False             # <<<<<<<<<<<<<<
 * 
 *             if not end_of_item:
*/
        __pyx_v_array_is_empty = 0;

        /* "asyncpg/protocol/codecs/array.pyx":795
 *                 stride_len[nest_level - 1] += 1
 * 
 *             elif not apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *                 if parse_state not in (APS_STRIDE_STARTED,
 *                                        APS_ELEM_STARTED,
*/
      }
      __pyx_L9:;

      /* "asyncpg/protocol/codecs/array.pyx":804
 *                 array_is_empty = False
 * 
 *             if not end_of_item:             # <<<<<<<<<<<<<<
 *                 ptr += 1
 * 
*/
      __pyx_t_6 = (!__pyx_v_end_of_item);
      if (__pyx_t_6) {

        /* "asyncpg/protocol/codecs/array.pyx":805
 * 
 *             if not end_of_item:
 *                 ptr += 1             # <<<<<<<<<<<<<<
 * 
 *         if not array_is_empty:
*/
        __pyx_v_ptr = (__pyx_v_ptr + 1);

        /* "asyncpg/protocol/codecs/array.pyx":804
 *                 array_is_empty = False
 * 
 *             if not end_of_item:             # <<<<<<<<<<<<<<
 *                 ptr += 1
 * 
*/
      }
    }

    /* "asyncpg/protocol/codecs/array.pyx":807
 *                 ptr += 1
 * 
 *         if not array_is_empty:             # <<<<<<<<<<<<<<
 *             dims[ndims[0] - 1] += 1
 * 
*/
    __pyx_t_6 = (!__pyx_v_array_is_empty);
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/array.pyx":808
 * 
 *         if not array_is_empty:
 *             dims[ndims[0] - 1] += 1             # <<<<<<<<<<<<<<
 * 
 *         ptr += 1
*/
      __pyx_t_11 = ((__pyx_v_ndims[0]) - 1);
      (__pyx_v_dims[__pyx_t_11]) = ((__pyx_v_dims[__pyx_t_11]) + 1);

      /* "asyncpg/protocol/codecs/array.pyx":807
 *                 ptr += 1
 * 
 *         if not array_is_empty:             # <<<<<<<<<<<<<<
 *             dims[ndims[0] - 1] += 1
 * 
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":810
 *             dims[ndims[0] - 1] += 1
 * 
 *         ptr += 1             # <<<<<<<<<<<<<<
 * 
 *     # only whitespace is allowed after the closing brace
*/
    __pyx_v_ptr = (__pyx_v_ptr + 1);
  }

  /* "asyncpg/protocol/codecs/array.pyx":813
 * 
 *     # only whitespace is allowed after the closing brace
 *     while ptr[0] != '\0':             # <<<<<<<<<<<<<<
 *         if not apg_ascii_isspace(ptr[0]):
 *             raise _UnexpectedCharacter(array_text, ptr)
*/
  while (1) {
    __pyx_t_6 = ((__pyx_v_ptr[0]) != 0);
    if (!__pyx_t_6) break;

    /* "asyncpg/protocol/codecs/array.pyx":814
 *     # only whitespace is allowed after the closing brace
 *     while ptr[0] != '\0':
 *         if not apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *             raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
    __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_apg_ascii_isspace((__pyx_v_ptr[0])); if (unlikely(__pyx_t_6 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(2, 814, __pyx_L1_error)
    __pyx_t_2 = (!__pyx_t_6);
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/codecs/array.pyx":815
 *     while ptr[0] != '\0':
 *         if not apg_ascii_isspace(ptr[0]):
 *             raise _UnexpectedCharacter(array_text, ptr)             # <<<<<<<<<<<<<<
 * 
 *         ptr += 1
*/
      __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol__UnexpectedCharacter(__pyx_v_array_text, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(2, 815, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/array.pyx":814
 *     # only whitespace is allowed after the closing brace
 *     while ptr[0] != '\0':
 *         if not apg_ascii_isspace(ptr[0]):             # <<<<<<<<<<<<<<
 *             raise _UnexpectedCharacter(array_text, ptr)
 * 
*/
    }

    /* "asyncpg/protocol/codecs/array.pyx":817
 *             raise _UnexpectedCharacter(array_text, ptr)
 * 
 *         ptr += 1             # <<<<<<<<<<<<<<
 * 
 *     if array_is_empty:
*/
    __pyx_v_ptr = (__pyx_v_ptr + 1);
  }

  /* "asyncpg/protocol/codecs/array.pyx":819
 *         ptr += 1
 * 
 *     if array_is_empty:             # <<<<<<<<<<<<<<
 *         ndims[0] = 0
 * 
*/
  if (__pyx_v_array_is_empty) {

    /* "asyncpg/protocol/codecs/array.pyx":820
 * 
 *     if array_is_empty:
 *         ndims[0] = 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
    (__pyx_v_ndims[0]) = 0;

    /* "asyncpg/protocol/codecs/array.pyx":819
 *         ptr += 1
 * 
 *     if array_is_empty:             # <<<<<<<<<<<<<<
 *         ndims[0] = 0
 * 
*/
  }

  /* "asyncpg/protocol/codecs/array.pyx":683
 * 
 * 
 * cdef _infer_array_dims(const Py_UCS4 *array_text,             # <<<<<<<<<<<<<<
 *                        Py_UCS4 typdelim,
 *                        int32_t *dims,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._infer_array_dims", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":823
 * 
 * 
 * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,             # <<<<<<<<<<<<<<
 *                      const void *arg):
 *     return pgproto.uint4_encode(settings, buf, obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uint4_encode_ex", 0);

  /* "asyncpg/protocol/codecs/array.pyx":825
 * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,
 *                      const void *arg):
 *     return pgproto.uint4_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":823
 * 
 * 
 * cdef uint4_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,             # <<<<<<<<<<<<<<
 *                      const void *arg):
 *     return pgproto.uint4_encode(settings, buf, obj)
*/

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

/* "asyncpg/protocol/codecs/array.pyx":828
 * 
 * 
 * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                      const void *arg):
 *     return pgproto.uint4_decode(settings, buf)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("uint4_decode_ex", 0);

  /* "asyncpg/protocol/codecs/array.pyx":830
 * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf,
 *                      const void *arg):
 *     return pgproto.uint4_decode(settings, buf)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":828
 * 
 * 
 * cdef uint4_decode_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                      const void *arg):
 *     return pgproto.uint4_decode(settings, buf)
*/

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

/* "asyncpg/protocol/codecs/array.pyx":833
 * 
 * 
 * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items):             # <<<<<<<<<<<<<<
 *     array_encode(settings, buf, items, OIDOID,
 *                  <encode_func_ex>&uint4_encode_ex, NULL)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrayoid_encode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":834
 * 
 * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items):
 *     array_encode(settings, buf, items, OIDOID,             # <<<<<<<<<<<<<<
 *                  <encode_func_ex>&uint4_encode_ex, NULL)
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_items, 26, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_uint4_encode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":833
 * 
 * 
 * cdef arrayoid_encode(ConnectionSettings settings, WriteBuffer buf, items):             # <<<<<<<<<<<<<<
 *     array_encode(settings, buf, items, OIDOID,
 *                  <encode_func_ex>&uint4_encode_ex, NULL)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.arrayoid_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":838
 * 
 * 
 * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return array_decode(settings, buf, <decode_func_ex>&uint4_decode_ex, NULL)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arrayoid_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":839
 * 
 * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf):
 *     return array_decode(settings, buf, <decode_func_ex>&uint4_decode_ex, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_uint4_decode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":838
 * 
 * 
 * cdef arrayoid_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return array_decode(settings, buf, <decode_func_ex>&uint4_decode_ex, NULL)
 * 
*/

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

/* "asyncpg/protocol/codecs/array.pyx":842
 * 
 * 
 * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,             # <<<<<<<<<<<<<<
 *                     const void *arg):
 *     return pgproto.text_encode(settings, buf, obj)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("text_encode_ex", 0);

  /* "asyncpg/protocol/codecs/array.pyx":844
 * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,
 *                     const void *arg):
 *     return pgproto.text_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_encode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":842
 * 
 * 
 * cdef text_encode_ex(ConnectionSettings settings, WriteBuffer buf, object obj,             # <<<<<<<<<<<<<<
 *                     const void *arg):
 *     return pgproto.text_encode(settings, buf, obj)
*/

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

/* "asyncpg/protocol/codecs/array.pyx":847
 * 
 * 
 * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                     const void *arg):
 *     return pgproto.text_decode(settings, buf)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, CYTHON_UNUSED void const *__pyx_v_arg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("text_decode_ex", 0);

  /* "asyncpg/protocol/codecs/array.pyx":849
 * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf,
 *                     const void *arg):
 *     return pgproto.text_decode(settings, buf)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_text_decode(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *)__pyx_v_settings), __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":847
 * 
 * 
 * cdef text_decode_ex(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                     const void *arg):
 *     return pgproto.text_decode(settings, buf)
*/

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

/* "asyncpg/protocol/codecs/array.pyx":852
 * 
 * 
 * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items):             # <<<<<<<<<<<<<<
 *     array_encode(settings, buf, items, TEXTOID,
 *                  <encode_func_ex>&text_encode_ex, NULL)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_items) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arraytext_encode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":853
 * 
 * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items):
 *     array_encode(settings, buf, items, TEXTOID,             # <<<<<<<<<<<<<<
 *                  <encode_func_ex>&text_encode_ex, NULL)
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_items, 25, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_text_encode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":852
 * 
 * 
 * cdef arraytext_encode(ConnectionSettings settings, WriteBuffer buf, items):             # <<<<<<<<<<<<<<
 *     array_encode(settings, buf, items, TEXTOID,
 *                  <encode_func_ex>&text_encode_ex, NULL)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.arraytext_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/array.pyx":857
 * 
 * 
 * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return array_decode(settings, buf, <decode_func_ex>&text_decode_ex, NULL)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arraytext_decode", 0);

  /* "asyncpg/protocol/codecs/array.pyx":858
 * 
 * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf):
 *     return array_decode(settings, buf, <decode_func_ex>&text_decode_ex, NULL)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_array_decode(__pyx_v_settings, __pyx_v_buf, ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex)(&__pyx_f_7asyncpg_8protocol_8protocol_text_decode_ex)), NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/array.pyx":857
 * 
 * 
 * cdef arraytext_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return array_decode(settings, buf, <decode_func_ex>&text_decode_ex, NULL)
 * 
*/

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

/* "asyncpg/protocol/codecs/array.pyx":861
 * 
 * 
 * cdef init_array_codecs():             # <<<<<<<<<<<<<<
 *     # oid[] and text[] are registered as core codecs
 *     # to make type introspection query work
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_array_codecs", 0);

  /* "asyncpg/protocol/codecs/array.pyx":865
 *     # to make type introspection query work
 *     #
 *     register_core_codec(_OIDOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>&arrayoid_encode,
 *                         <decode_func>&arrayoid_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x404, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arrayoid_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":870
 *                         PG_FORMAT_BINARY)
 * 
 *     register_core_codec(_TEXTOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>&arraytext_encode,
 *                         <decode_func>&arraytext_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x3F1, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arraytext_encode)), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)(&__pyx_f_7asyncpg_8protocol_8protocol_arraytext_decode)), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":861
 * 
 * 
 * cdef init_array_codecs():             # <<<<<<<<<<<<<<
 *     # oid[] and text[] are registered as core codecs
 *     # to make type introspection query work
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_array_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":26
 * 
 * 
 * cdef inline bint _range_has_lbound(uint8_t flags):             # <<<<<<<<<<<<<<
 *     return not (flags & (RANGE_EMPTY | RANGE_LB_INF))
 * 
*/

static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(uint8_t __pyx_v_flags) {
  int __pyx_r;

  /* "asyncpg/protocol/codecs/range.pyx":27
 * 
 * cdef inline bint _range_has_lbound(uint8_t flags):
 *     return not (flags & (RANGE_EMPTY | RANGE_LB_INF))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = (!((__pyx_v_flags & 0x9) != 0));
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/range.pyx":26
 * 
 * 
 * cdef inline bint _range_has_lbound(uint8_t flags):             # <<<<<<<<<<<<<<
 *     return not (flags & (RANGE_EMPTY | RANGE_LB_INF))
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":30
 * 
 * 
 * cdef inline bint _range_has_ubound(uint8_t flags):             # <<<<<<<<<<<<<<
 *     return not (flags & (RANGE_EMPTY | RANGE_UB_INF))
 * 
*/

static CYTHON_INLINE int __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(uint8_t __pyx_v_flags) {
  int __pyx_r;

  /* "asyncpg/protocol/codecs/range.pyx":31
 * 
 * cdef inline bint _range_has_ubound(uint8_t flags):
 *     return not (flags & (RANGE_EMPTY | RANGE_UB_INF))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = (!((__pyx_v_flags & 0x11) != 0));
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/range.pyx":30
 * 
 * 
 * cdef inline bint _range_has_ubound(uint8_t flags):             # <<<<<<<<<<<<<<
 *     return not (flags & (RANGE_EMPTY | RANGE_UB_INF))
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":34
 * 
 * 
 * cdef inline _RangeArgumentType _range_type(object obj):             # <<<<<<<<<<<<<<
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):
 *         return _RANGE_ARGUMENT_TUPLE
*/

static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_f_7asyncpg_8protocol_8protocol__range_type(PyObject *__pyx_v_obj) {
  enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_range_type", 0);

  /* "asyncpg/protocol/codecs/range.pyx":35
 * 
 * cdef inline _RangeArgumentType _range_type(object obj):
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):             # <<<<<<<<<<<<<<
 *         return _RANGE_ARGUMENT_TUPLE
 *     elif isinstance(obj, apg_types.Range):
*/
  __pyx_t_2 = PyTuple_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyList_Check(__pyx_v_obj);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/range.pyx":36
 * cdef inline _RangeArgumentType _range_type(object obj):
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):
 *         return _RANGE_ARGUMENT_TUPLE             # <<<<<<<<<<<<<<
 *     elif isinstance(obj, apg_types.Range):
 *         return _RANGE_ARGUMENT_RANGE
*/
    __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/range.pyx":35
 * 
 * cdef inline _RangeArgumentType _range_type(object obj):
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):             # <<<<<<<<<<<<<<
 *         return _RANGE_ARGUMENT_TUPLE
 *     elif isinstance(obj, apg_types.Range):
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":37
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):
 *         return _RANGE_ARGUMENT_TUPLE
 *     elif isinstance(obj, apg_types.Range):             # <<<<<<<<<<<<<<
 *         return _RANGE_ARGUMENT_RANGE
 *     else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Range); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(12, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/codecs/range.pyx":38
 *         return _RANGE_ARGUMENT_TUPLE
 *     elif isinstance(obj, apg_types.Range):
 *         return _RANGE_ARGUMENT_RANGE             # <<<<<<<<<<<<<<
 *     else:
 *         return _RANGE_ARGUMENT_INVALID
*/
    __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_RANGE;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/range.pyx":37
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):
 *         return _RANGE_ARGUMENT_TUPLE
 *     elif isinstance(obj, apg_types.Range):             # <<<<<<<<<<<<<<
 *         return _RANGE_ARGUMENT_RANGE
 *     else:
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":40
 *         return _RANGE_ARGUMENT_RANGE
 *     else:
 *         return _RANGE_ARGUMENT_INVALID             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __pyx_r = __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID;
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/codecs/range.pyx":34
 * 
 * 
 * cdef inline _RangeArgumentType _range_type(object obj):             # <<<<<<<<<<<<<<
 *     if cpython.PyTuple_Check(obj) or cpython.PyList_Check(obj):
 *         return _RANGE_ARGUMENT_TUPLE
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._range_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":43
 * 
 * 
 * cdef range_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                   object obj, uint32_t elem_oid,
 *                   encode_func_ex encoder, const void *encoder_arg):
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, CYTHON_UNUSED uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) {
  Py_ssize_t __pyx_v_obj_len;
  uint8_t __pyx_v_flags;
  PyObject *__pyx_v_lower = 0;
  PyObject *__pyx_v_upper = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bounds_data = 0;
  enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_v_arg_type;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  enum __pyx_t_7asyncpg_8protocol_8protocol__RangeArgumentType __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int32_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("range_encode", 0);

  /* "asyncpg/protocol/codecs/range.pyx":48
 *     cdef:
 *         ssize_t obj_len
 *         uint8_t flags = 0             # <<<<<<<<<<<<<<
 *         object lower = None
 *         object upper = None
*/
  __pyx_v_flags = 0;

  /* "asyncpg/protocol/codecs/range.pyx":49
 *         ssize_t obj_len
 *         uint8_t flags = 0
 *         object lower = None             # <<<<<<<<<<<<<<
 *         object upper = None
 *         WriteBuffer bounds_data = WriteBuffer.new()
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_lower = Py_None;

  /* "asyncpg/protocol/codecs/range.pyx":50
 *         uint8_t flags = 0
 *         object lower = None
 *         object upper = None             # <<<<<<<<<<<<<<
 *         WriteBuffer bounds_data = WriteBuffer.new()
 *         _RangeArgumentType arg_type = _range_type(obj)
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_upper = Py_None;

  /* "asyncpg/protocol/codecs/range.pyx":51
 *         object lower = None
 *         object upper = None
 *         WriteBuffer bounds_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         _RangeArgumentType arg_type = _range_type(obj)
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bounds_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":52
 *         object upper = None
 *         WriteBuffer bounds_data = WriteBuffer.new()
 *         _RangeArgumentType arg_type = _range_type(obj)             # <<<<<<<<<<<<<<
 * 
 *     if arg_type == _RANGE_ARGUMENT_INVALID:
*/
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_type(__pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(12, 52, __pyx_L1_error)
  __pyx_v_arg_type = __pyx_t_2;

  /* "asyncpg/protocol/codecs/range.pyx":54
 *         _RangeArgumentType arg_type = _range_type(obj)
 * 
 *     if arg_type == _RANGE_ARGUMENT_INVALID:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'list, tuple or Range object expected (got type {})'.format(
*/
  switch (__pyx_v_arg_type) {
    case __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_INVALID:

    /* "asyncpg/protocol/codecs/range.pyx":55
 * 
 *     if arg_type == _RANGE_ARGUMENT_INVALID:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'list, tuple or Range object expected (got type {})'.format(
 *                 type(obj)))
*/
    __pyx_t_3 = NULL;

    /* "asyncpg/protocol/codecs/range.pyx":56
 *     if arg_type == _RANGE_ARGUMENT_INVALID:
 *         raise TypeError(
 *             'list, tuple or Range object expected (got type {})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj)))
 * 
*/
    __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_list_tuple_or_Range_object_expec;
    __Pyx_INCREF(__pyx_t_5);

    /* "asyncpg/protocol/codecs/range.pyx":57
 *         raise TypeError(
 *             'list, tuple or Range object expected (got type {})'.format(
 *                 type(obj)))             # <<<<<<<<<<<<<<
 * 
 *     elif arg_type == _RANGE_ARGUMENT_TUPLE:
*/
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_obj))};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 55, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(12, 55, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/range.pyx":54
 *         _RangeArgumentType arg_type = _range_type(obj)
 * 
 *     if arg_type == _RANGE_ARGUMENT_INVALID:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'list, tuple or Range object expected (got type {})'.format(
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol__RANGE_ARGUMENT_TUPLE:

    /* "asyncpg/protocol/codecs/range.pyx":60
 * 
 *     elif arg_type == _RANGE_ARGUMENT_TUPLE:
 *         obj_len = len(obj)             # <<<<<<<<<<<<<<
 *         if obj_len == 2:
 *             lower = obj[0]
*/
    __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(12, 60, __pyx_L1_error)
    __pyx_v_obj_len = __pyx_t_7;

    /* "asyncpg/protocol/codecs/range.pyx":61
 *     elif arg_type == _RANGE_ARGUMENT_TUPLE:
 *         obj_len = len(obj)
 *         if obj_len == 2:             # <<<<<<<<<<<<<<
 *             lower = obj[0]
 *             upper = obj[1]
*/
    switch (__pyx_v_obj_len) {
      case 2:

      /* "asyncpg/protocol/codecs/range.pyx":62
 *         obj_len = len(obj)
 *         if obj_len == 2:
 *             lower = obj[0]             # <<<<<<<<<<<<<<
 *             upper = obj[1]
 * 
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/range.pyx":63
 *         if obj_len == 2:
 *             lower = obj[0]
 *             upper = obj[1]             # <<<<<<<<<<<<<<
 * 
 *             if lower is None:
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 63, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/range.pyx":65
 *             upper = obj[1]
 * 
 *             if lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 * 
*/
      __pyx_t_8 = (__pyx_v_lower == Py_None);
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":66
 * 
 *             if lower is None:
 *                 flags |= RANGE_LB_INF             # <<<<<<<<<<<<<<
 * 
 *             if upper is None:
*/
        __pyx_v_flags = (__pyx_v_flags | 8);

        /* "asyncpg/protocol/codecs/range.pyx":65
 *             upper = obj[1]
 * 
 *             if lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 * 
*/
      }

      /* "asyncpg/protocol/codecs/range.pyx":68
 *                 flags |= RANGE_LB_INF
 * 
 *             if upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 * 
*/
      __pyx_t_8 = (__pyx_v_upper == Py_None);
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":69
 * 
 *             if upper is None:
 *                 flags |= RANGE_UB_INF             # <<<<<<<<<<<<<<
 * 
 *             flags |= RANGE_LB_INC | RANGE_UB_INC
*/
        __pyx_v_flags = (__pyx_v_flags | 16);

        /* "asyncpg/protocol/codecs/range.pyx":68
 *                 flags |= RANGE_LB_INF
 * 
 *             if upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 * 
*/
      }

      /* "asyncpg/protocol/codecs/range.pyx":71
 *                 flags |= RANGE_UB_INF
 * 
 *             flags |= RANGE_LB_INC | RANGE_UB_INC             # <<<<<<<<<<<<<<
 * 
 *         elif obj_len == 1:
*/
      __pyx_v_flags = (__pyx_v_flags | 0x6);

      /* "asyncpg/protocol/codecs/range.pyx":61
 *     elif arg_type == _RANGE_ARGUMENT_TUPLE:
 *         obj_len = len(obj)
 *         if obj_len == 2:             # <<<<<<<<<<<<<<
 *             lower = obj[0]
 *             upper = obj[1]
*/
      break;
      case 1:

      /* "asyncpg/protocol/codecs/range.pyx":74
 * 
 *         elif obj_len == 1:
 *             lower = obj[0]             # <<<<<<<<<<<<<<
 *             flags |= RANGE_LB_INC | RANGE_UB_INF
 * 
*/
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 74, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/range.pyx":75
 *         elif obj_len == 1:
 *             lower = obj[0]
 *             flags |= RANGE_LB_INC | RANGE_UB_INF             # <<<<<<<<<<<<<<
 * 
 *         elif obj_len == 0:
*/
      __pyx_v_flags = (__pyx_v_flags | 0x12);

      /* "asyncpg/protocol/codecs/range.pyx":73
 *             flags |= RANGE_LB_INC | RANGE_UB_INC
 * 
 *         elif obj_len == 1:             # <<<<<<<<<<<<<<
 *             lower = obj[0]
 *             flags |= RANGE_LB_INC | RANGE_UB_INF
*/
      break;
      case 0:

      /* "asyncpg/protocol/codecs/range.pyx":78
 * 
 *         elif obj_len == 0:
 *             flags |= RANGE_EMPTY             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
      __pyx_v_flags = (__pyx_v_flags | 1);

      /* "asyncpg/protocol/codecs/range.pyx":77
 *             flags |= RANGE_LB_INC | RANGE_UB_INF
 * 
 *         elif obj_len == 0:             # <<<<<<<<<<<<<<
 *             flags |= RANGE_EMPTY
 * 
*/
      break;
      default:

      /* "asyncpg/protocol/codecs/range.pyx":81
 * 
 *         else:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'expected 0, 1 or 2 elements in range (got {})'.format(
 *                     obj_len))
*/
      __pyx_t_4 = NULL;

      /* "asyncpg/protocol/codecs/range.pyx":82
 *         else:
 *             raise ValueError(
 *                 'expected 0, 1 or 2 elements in range (got {})'.format(             # <<<<<<<<<<<<<<
 *                     obj_len))
 * 
*/
      __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u_expected_0_1_or_2_elements_in_ra;
      __Pyx_INCREF(__pyx_t_5);

      /* "asyncpg/protocol/codecs/range.pyx":83
 *             raise ValueError(
 *                 'expected 0, 1 or 2 elements in range (got {})'.format(
 *                     obj_len))             # <<<<<<<<<<<<<<
 * 
 *     else:
*/
      __pyx_t_9 = PyLong_FromSsize_t(__pyx_v_obj_len); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 83, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 82, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 81, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(12, 81, __pyx_L1_error)
      break;
    }

    /* "asyncpg/protocol/codecs/range.pyx":59
 *                 type(obj)))
 * 
 *     elif arg_type == _RANGE_ARGUMENT_TUPLE:             # <<<<<<<<<<<<<<
 *         obj_len = len(obj)
 *         if obj_len == 2:
*/
    break;
    default:

    /* "asyncpg/protocol/codecs/range.pyx":86
 * 
 *     else:
 *         if obj.isempty:             # <<<<<<<<<<<<<<
 *             flags |= RANGE_EMPTY
 *         else:
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_isempty); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "asyncpg/protocol/codecs/range.pyx":87
 *     else:
 *         if obj.isempty:
 *             flags |= RANGE_EMPTY             # <<<<<<<<<<<<<<
 *         else:
 *             lower = obj.lower
*/
      __pyx_v_flags = (__pyx_v_flags | 1);

      /* "asyncpg/protocol/codecs/range.pyx":86
 * 
 *     else:
 *         if obj.isempty:             # <<<<<<<<<<<<<<
 *             flags |= RANGE_EMPTY
 *         else:
*/
      goto __pyx_L5;
    }

    /* "asyncpg/protocol/codecs/range.pyx":89
 *             flags |= RANGE_EMPTY
 *         else:
 *             lower = obj.lower             # <<<<<<<<<<<<<<
 *             upper = obj.upper
 * 
*/
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/range.pyx":90
 *         else:
 *             lower = obj.lower
 *             upper = obj.upper             # <<<<<<<<<<<<<<
 * 
 *             if obj.lower_inc:
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/codecs/range.pyx":92
 *             upper = obj.upper
 * 
 *             if obj.lower_inc:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INC
 *             elif lower is None:
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_lower_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 92, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":93
 * 
 *             if obj.lower_inc:
 *                 flags |= RANGE_LB_INC             # <<<<<<<<<<<<<<
 *             elif lower is None:
 *                 flags |= RANGE_LB_INF
*/
        __pyx_v_flags = (__pyx_v_flags | 2);

        /* "asyncpg/protocol/codecs/range.pyx":92
 *             upper = obj.upper
 * 
 *             if obj.lower_inc:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INC
 *             elif lower is None:
*/
        goto __pyx_L6;
      }

      /* "asyncpg/protocol/codecs/range.pyx":94
 *             if obj.lower_inc:
 *                 flags |= RANGE_LB_INC
 *             elif lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 * 
*/
      __pyx_t_8 = (__pyx_v_lower == Py_None);
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":95
 *                 flags |= RANGE_LB_INC
 *             elif lower is None:
 *                 flags |= RANGE_LB_INF             # <<<<<<<<<<<<<<
 * 
 *             if obj.upper_inc:
*/
        __pyx_v_flags = (__pyx_v_flags | 8);

        /* "asyncpg/protocol/codecs/range.pyx":94
 *             if obj.lower_inc:
 *                 flags |= RANGE_LB_INC
 *             elif lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 * 
*/
      }
      __pyx_L6:;

      /* "asyncpg/protocol/codecs/range.pyx":97
 *                 flags |= RANGE_LB_INF
 * 
 *             if obj.upper_inc:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INC
 *             elif upper is None:
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_mstate_global->__pyx_n_u_upper_inc); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 97, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(12, 97, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":98
 * 
 *             if obj.upper_inc:
 *                 flags |= RANGE_UB_INC             # <<<<<<<<<<<<<<
 *             elif upper is None:
 *                 flags |= RANGE_UB_INF
*/
        __pyx_v_flags = (__pyx_v_flags | 4);

        /* "asyncpg/protocol/codecs/range.pyx":97
 *                 flags |= RANGE_LB_INF
 * 
 *             if obj.upper_inc:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INC
 *             elif upper is None:
*/
        goto __pyx_L7;
      }

      /* "asyncpg/protocol/codecs/range.pyx":99
 *             if obj.upper_inc:
 *                 flags |= RANGE_UB_INC
 *             elif upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 * 
*/
      __pyx_t_8 = (__pyx_v_upper == Py_None);
      if (__pyx_t_8) {

        /* "asyncpg/protocol/codecs/range.pyx":100
 *                 flags |= RANGE_UB_INC
 *             elif upper is None:
 *                 flags |= RANGE_UB_INF             # <<<<<<<<<<<<<<
 * 
 *     if _range_has_lbound(flags):
*/
        __pyx_v_flags = (__pyx_v_flags | 16);

        /* "asyncpg/protocol/codecs/range.pyx":99
 *             if obj.upper_inc:
 *                 flags |= RANGE_UB_INC
 *             elif upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 * 
*/
      }
      __pyx_L7:;
    }
    __pyx_L5:;
    break;
  }

  /* "asyncpg/protocol/codecs/range.pyx":102
 *                 flags |= RANGE_UB_INF
 * 
 *     if _range_has_lbound(flags):             # <<<<<<<<<<<<<<
 *         encoder(settings, bounds_data, lower, encoder_arg)
 * 
*/
  __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 102, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "asyncpg/protocol/codecs/range.pyx":103
 * 
 *     if _range_has_lbound(flags):
 *         encoder(settings, bounds_data, lower, encoder_arg)             # <<<<<<<<<<<<<<
 * 
 *     if _range_has_ubound(flags):
*/
    __pyx_t_1 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_bounds_data, __pyx_v_lower, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":102
 *                 flags |= RANGE_UB_INF
 * 
 *     if _range_has_lbound(flags):             # <<<<<<<<<<<<<<
 *         encoder(settings, bounds_data, lower, encoder_arg)
 * 
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":105
 *         encoder(settings, bounds_data, lower, encoder_arg)
 * 
 *     if _range_has_ubound(flags):             # <<<<<<<<<<<<<<
 *         encoder(settings, bounds_data, upper, encoder_arg)
 * 
*/
  __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 105, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "asyncpg/protocol/codecs/range.pyx":106
 * 
 *     if _range_has_ubound(flags):
 *         encoder(settings, bounds_data, upper, encoder_arg)             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(1 + bounds_data.len())
*/
    __pyx_t_1 = __pyx_v_encoder(__pyx_v_settings, __pyx_v_bounds_data, __pyx_v_upper, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":105
 *         encoder(settings, bounds_data, lower, encoder_arg)
 * 
 *     if _range_has_ubound(flags):             # <<<<<<<<<<<<<<
 *         encoder(settings, bounds_data, upper, encoder_arg)
 * 
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":108
 *         encoder(settings, bounds_data, upper, encoder_arg)
 * 
 *     buf.write_int32(1 + bounds_data.len())             # <<<<<<<<<<<<<<
 *     buf.write_byte(<int8_t>flags)
 *     buf.write_buffer(bounds_data)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_bounds_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_1, __pyx_t_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(12, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":109
 * 
 *     buf.write_int32(1 + bounds_data.len())
 *     buf.write_byte(<int8_t>flags)             # <<<<<<<<<<<<<<
 *     buf.write_buffer(bounds_data)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, ((int8_t)__pyx_v_flags)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":110
 *     buf.write_int32(1 + bounds_data.len())
 *     buf.write_byte(<int8_t>flags)
 *     buf.write_buffer(bounds_data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_bounds_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":43
 * 
 * 
 * cdef range_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                   object obj, uint32_t elem_oid,
 *                   encode_func_ex encoder, const void *encoder_arg):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.range_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lower);
  __Pyx_XDECREF(__pyx_v_upper);
  __Pyx_XDECREF((PyObject *)__pyx_v_bounds_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":113
 * 
 * 
 * cdef range_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                   decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_range_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) {
  uint8_t __pyx_v_flags;
  int32_t __pyx_v_bound_len;
  PyObject *__pyx_v_lower = 0;
  PyObject *__pyx_v_upper = 0;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_bound_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("range_decode", 0);

  /* "asyncpg/protocol/codecs/range.pyx":116
 *                   decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
 *         uint8_t flags = <uint8_t>frb_read(buf, 1)[0]             # <<<<<<<<<<<<<<
 *         int32_t bound_len
 *         object lower = None
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(12, 116, __pyx_L1_error)
  __pyx_v_flags = ((uint8_t)(__pyx_t_1[0]));

  /* "asyncpg/protocol/codecs/range.pyx":118
 *         uint8_t flags = <uint8_t>frb_read(buf, 1)[0]
 *         int32_t bound_len
 *         object lower = None             # <<<<<<<<<<<<<<
 *         object upper = None
 *         FRBuffer bound_buf
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_lower = Py_None;

  /* "asyncpg/protocol/codecs/range.pyx":119
 *         int32_t bound_len
 *         object lower = None
 *         object upper = None             # <<<<<<<<<<<<<<
 *         FRBuffer bound_buf
 * 
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_upper = Py_None;

  /* "asyncpg/protocol/codecs/range.pyx":122
 *         FRBuffer bound_buf
 * 
 *     if _range_has_lbound(flags):             # <<<<<<<<<<<<<<
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
*/
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_lbound(__pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 122, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/range.pyx":123
 * 
 *     if _range_has_lbound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if bound_len == -1:
 *             lower = None
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(12, 123, __pyx_L1_error)
    __pyx_v_bound_len = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/range.pyx":124
 *     if _range_has_lbound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:             # <<<<<<<<<<<<<<
 *             lower = None
 *         else:
*/
    __pyx_t_2 = (__pyx_v_bound_len == -1L);
    if (__pyx_t_2) {

      /* "asyncpg/protocol/codecs/range.pyx":125
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
 *             lower = None             # <<<<<<<<<<<<<<
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)
*/
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_lower, Py_None);

      /* "asyncpg/protocol/codecs/range.pyx":124
 *     if _range_has_lbound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:             # <<<<<<<<<<<<<<
 *             lower = None
 *         else:
*/
      goto __pyx_L4;
    }

    /* "asyncpg/protocol/codecs/range.pyx":127
 *             lower = None
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)             # <<<<<<<<<<<<<<
 *             lower = decoder(settings, &bound_buf, decoder_arg)
 * 
*/
    /*else*/ {
      __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_bound_buf), __pyx_v_buf, __pyx_v_bound_len); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 127, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/range.pyx":128
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)
 *             lower = decoder(settings, &bound_buf, decoder_arg)             # <<<<<<<<<<<<<<
 * 
 *     if _range_has_ubound(flags):
*/
      __pyx_t_4 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_bound_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L4:;

    /* "asyncpg/protocol/codecs/range.pyx":122
 *         FRBuffer bound_buf
 * 
 *     if _range_has_lbound(flags):             # <<<<<<<<<<<<<<
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":130
 *             lower = decoder(settings, &bound_buf, decoder_arg)
 * 
 *     if _range_has_ubound(flags):             # <<<<<<<<<<<<<<
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
*/
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol__range_has_ubound(__pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(12, 130, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/range.pyx":131
 * 
 *     if _range_has_ubound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if bound_len == -1:
 *             upper = None
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(12, 131, __pyx_L1_error)
    __pyx_v_bound_len = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/range.pyx":132
 *     if _range_has_ubound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:             # <<<<<<<<<<<<<<
 *             upper = None
 *         else:
*/
    __pyx_t_2 = (__pyx_v_bound_len == -1L);
    if (__pyx_t_2) {

      /* "asyncpg/protocol/codecs/range.pyx":133
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
 *             upper = None             # <<<<<<<<<<<<<<
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)
*/
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_upper, Py_None);

      /* "asyncpg/protocol/codecs/range.pyx":132
 *     if _range_has_ubound(flags):
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:             # <<<<<<<<<<<<<<
 *             upper = None
 *         else:
*/
      goto __pyx_L6;
    }

    /* "asyncpg/protocol/codecs/range.pyx":135
 *             upper = None
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)             # <<<<<<<<<<<<<<
 *             upper = decoder(settings, &bound_buf, decoder_arg)
 * 
*/
    /*else*/ {
      __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_bound_buf), __pyx_v_buf, __pyx_v_bound_len); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 135, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/range.pyx":136
 *         else:
 *             frb_slice_from(&bound_buf, buf, bound_len)
 *             upper = decoder(settings, &bound_buf, decoder_arg)             # <<<<<<<<<<<<<<
 * 
 *     return apg_types.Range(lower=lower, upper=upper,
*/
      __pyx_t_4 = __pyx_v_decoder(__pyx_v_settings, (&__pyx_v_bound_buf), __pyx_v_decoder_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L6:;

    /* "asyncpg/protocol/codecs/range.pyx":130
 *             lower = decoder(settings, &bound_buf, decoder_arg)
 * 
 *     if _range_has_ubound(flags):             # <<<<<<<<<<<<<<
 *         bound_len = hton.unpack_int32(frb_read(buf, 4))
 *         if bound_len == -1:
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":138
 *             upper = decoder(settings, &bound_buf, decoder_arg)
 * 
 *     return apg_types.Range(lower=lower, upper=upper,             # <<<<<<<<<<<<<<
 *                            lower_inc=(flags & RANGE_LB_INC) != 0,
 *                            upper_inc=(flags & RANGE_UB_INC) != 0,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Range); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":139
 * 
 *     return apg_types.Range(lower=lower, upper=upper,
 *                            lower_inc=(flags & RANGE_LB_INC) != 0,             # <<<<<<<<<<<<<<
 *                            upper_inc=(flags & RANGE_UB_INC) != 0,
 *                            empty=(flags & RANGE_EMPTY) != 0)
*/
  __pyx_t_6 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 2) != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "asyncpg/protocol/codecs/range.pyx":140
 *     return apg_types.Range(lower=lower, upper=upper,
 *                            lower_inc=(flags & RANGE_LB_INC) != 0,
 *                            upper_inc=(flags & RANGE_UB_INC) != 0,             # <<<<<<<<<<<<<<
 *                            empty=(flags & RANGE_EMPTY) != 0)
 * 
*/
  __pyx_t_8 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 4) != 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "asyncpg/protocol/codecs/range.pyx":141
 *                            lower_inc=(flags & RANGE_LB_INC) != 0,
 *                            upper_inc=(flags & RANGE_UB_INC) != 0,
 *                            empty=(flags & RANGE_EMPTY) != 0)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_9 = __Pyx_PyBool_FromLong(((__pyx_v_flags & 1) != 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_5, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_lower, __pyx_v_lower, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(12, 138, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_upper, __pyx_v_upper, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(12, 138, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_lower_inc, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(12, 138, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_upper_inc, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(12, 138, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_empty, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(12, 138, __pyx_L1_error)
    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/range.pyx":113
 * 
 * 
 * cdef range_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                   decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.range_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lower);
  __Pyx_XDECREF(__pyx_v_upper);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":144
 * 
 * 
 * cdef multirange_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                        object obj, uint32_t elem_oid,
 *                        encode_func_ex encoder, const void *encoder_arg):
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_encode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, uint32_t __pyx_v_elem_oid, __pyx_t_7asyncpg_8protocol_8protocol_encode_func_ex __pyx_v_encoder, void const *__pyx_v_encoder_arg) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_elem_data_len;
  Py_ssize_t __pyx_v_elem_count;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("multirange_encode", 0);

  /* "asyncpg/protocol/codecs/range.pyx":152
 *         ssize_t elem_count
 * 
 *     if not isinstance(obj, SequenceABC):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'expected a sequence (got type {!r})'.format(type(obj).__name__)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SequenceABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(12, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/codecs/range.pyx":153
 * 
 *     if not isinstance(obj, SequenceABC):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'expected a sequence (got type {!r})'.format(type(obj).__name__)
 *         )
*/
    __pyx_t_4 = NULL;

    /* "asyncpg/protocol/codecs/range.pyx":154
 *     if not isinstance(obj, SequenceABC):
 *         raise TypeError(
 *             'expected a sequence (got type {!r})'.format(type(obj).__name__)             # <<<<<<<<<<<<<<
 *         )
 * 
*/
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got_type_r;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(12, 153, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/range.pyx":152
 *         ssize_t elem_count
 * 
 *     if not isinstance(obj, SequenceABC):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'expected a sequence (got type {!r})'.format(type(obj).__name__)
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":157
 *         )
 * 
 *     elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *     for elem in obj:
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":159
 *     elem_data = WriteBuffer.new()
 * 
 *     for elem in obj:             # <<<<<<<<<<<<<<
 *         range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg)
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(12, 159, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 159, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(12, 159, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 159, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_10(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(12, 159, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":160
 * 
 *     for elem in obj:
 *         range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg)             # <<<<<<<<<<<<<<
 * 
 *     elem_count = len(obj)
*/
    __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_range_encode(__pyx_v_settings, __pyx_v_elem_data, __pyx_v_elem, __pyx_v_elem_oid, __pyx_v_encoder, __pyx_v_encoder_arg); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":159
 *     elem_data = WriteBuffer.new()
 * 
 *     for elem in obj:             # <<<<<<<<<<<<<<
 *         range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":162
 *         range_encode(settings, elem_data, elem, elem_oid, encoder, encoder_arg)
 * 
 *     elem_count = len(obj)             # <<<<<<<<<<<<<<
 *     if elem_count > INT32_MAX:
 *         raise OverflowError(f'too many elements in multirange value')
*/
  __pyx_t_9 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(12, 162, __pyx_L1_error)
  __pyx_v_elem_count = __pyx_t_9;

  /* "asyncpg/protocol/codecs/range.pyx":163
 * 
 *     elem_count = len(obj)
 *     if elem_count > INT32_MAX:             # <<<<<<<<<<<<<<
 *         raise OverflowError(f'too many elements in multirange value')
 * 
*/
  __pyx_t_3 = (__pyx_v_elem_count > INT32_MAX);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/codecs/range.pyx":164
 *     elem_count = len(obj)
 *     if elem_count > INT32_MAX:
 *         raise OverflowError(f'too many elements in multirange value')             # <<<<<<<<<<<<<<
 * 
 *     elem_data_len = elem_data.len()
*/
    __pyx_t_5 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_multirange};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(12, 164, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/range.pyx":163
 * 
 *     elem_count = len(obj)
 *     if elem_count > INT32_MAX:             # <<<<<<<<<<<<<<
 *         raise OverflowError(f'too many elements in multirange value')
 * 
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":166
 *         raise OverflowError(f'too many elements in multirange value')
 * 
 *     elem_data_len = elem_data.len()             # <<<<<<<<<<<<<<
 *     if elem_data_len > INT32_MAX - 4:
 *         raise OverflowError(
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = PyLong_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(12, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_elem_data_len = __pyx_t_11;

  /* "asyncpg/protocol/codecs/range.pyx":167
 * 
 *     elem_data_len = elem_data.len()
 *     if elem_data_len > INT32_MAX - 4:             # <<<<<<<<<<<<<<
 *         raise OverflowError(
 *             f'size of encoded multirange datum exceeds the maximum allowed'
*/
  __pyx_t_3 = (__pyx_v_elem_data_len > (INT32_MAX - 4));
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/codecs/range.pyx":168
 *     elem_data_len = elem_data.len()
 *     if elem_data_len > INT32_MAX - 4:
 *         raise OverflowError(             # <<<<<<<<<<<<<<
 *             f'size of encoded multirange datum exceeds the maximum allowed'
 *             f' {INT32_MAX - 4} bytes')
*/
    __pyx_t_5 = NULL;

    /* "asyncpg/protocol/codecs/range.pyx":170
 *         raise OverflowError(
 *             f'size of encoded multirange datum exceeds the maximum allowed'
 *             f' {INT32_MAX - 4} bytes')             # <<<<<<<<<<<<<<
 * 
 *     # Datum length
*/
    __pyx_t_4 = __Pyx_PyUnicode_From_long((INT32_MAX - 4), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_size_of_encoded_multirange_datum;
    __pyx_t_12[1] = __pyx_t_4;
    __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_bytes;

    /* "asyncpg/protocol/codecs/range.pyx":169
 *     if elem_data_len > INT32_MAX - 4:
 *         raise OverflowError(
 *             f'size of encoded multirange datum exceeds the maximum allowed'             # <<<<<<<<<<<<<<
 *             f' {INT32_MAX - 4} bytes')
 * 
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, 61 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 6, 127);
    if (unlikely(!__pyx_t_7)) __PYX_ERR(12, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_OverflowError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(12, 168, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/range.pyx":167
 * 
 *     elem_data_len = elem_data.len()
 *     if elem_data_len > INT32_MAX - 4:             # <<<<<<<<<<<<<<
 *         raise OverflowError(
 *             f'size of encoded multirange datum exceeds the maximum allowed'
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":173
 * 
 *     # Datum length
 *     buf.write_int32(4 + <int32_t>elem_data_len)             # <<<<<<<<<<<<<<
 *     # Number of elements in multirange
 *     buf.write_int32(<int32_t>elem_count)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + ((int32_t)__pyx_v_elem_data_len))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":175
 *     buf.write_int32(4 + <int32_t>elem_data_len)
 *     # Number of elements in multirange
 *     buf.write_int32(<int32_t>elem_count)             # <<<<<<<<<<<<<<
 *     buf.write_buffer(elem_data)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_elem_count)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":176
 *     # Number of elements in multirange
 *     buf.write_int32(<int32_t>elem_count)
 *     buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":144
 * 
 * 
 * cdef multirange_encode(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                        object obj, uint32_t elem_oid,
 *                        encode_func_ex encoder, const void *encoder_arg):
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.multirange_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/range.pyx":179
 * 
 * 
 * cdef multirange_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                        decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_multirange_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, __pyx_t_7asyncpg_8protocol_8protocol_decode_func_ex __pyx_v_decoder, void const *__pyx_v_decoder_arg) {
  int32_t __pyx_v_nelems;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  int32_t __pyx_v_elem_len;
  int __pyx_v_i;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int32_t __pyx_t_10;
  int32_t __pyx_t_11;
  int __pyx_t_12;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("multirange_decode", 0);

  /* "asyncpg/protocol/codecs/range.pyx":182
 *                        decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
 *         int32_t nelems = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         FRBuffer elem_buf
 *         int32_t elem_len
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(12, 182, __pyx_L1_error)
  __pyx_v_nelems = unpack_int32(__pyx_t_1);

  /* "asyncpg/protocol/codecs/range.pyx":188
 *         list result
 * 
 *     if nelems == 0:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  __pyx_t_2 = (__pyx_v_nelems == 0);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/codecs/range.pyx":189
 * 
 *     if nelems == 0:
 *         return []             # <<<<<<<<<<<<<<
 * 
 *     if nelems < 0:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/codecs/range.pyx":188
 *         list result
 * 
 *     if nelems == 0:             # <<<<<<<<<<<<<<
 *         return []
 * 
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":191
 *         return []
 * 
 *     if nelems < 0:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'unexpected multirange size value: {}'.format(nelems))
*/
  __pyx_t_2 = (__pyx_v_nelems < 0);
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/codecs/range.pyx":192
 * 
 *     if nelems < 0:
 *         raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *             'unexpected multirange size value: {}'.format(nelems))
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(12, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":193
 *     if nelems < 0:
 *         raise exceptions.ProtocolError(
 *             'unexpected multirange size value: {}'.format(nelems))             # <<<<<<<<<<<<<<
 * 
 *     result = cpython.PyList_New(nelems)
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_unexpected_multirange_size_value;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_nelems); if (unlikely(!__pyx_t_8)) __PYX_ERR(12, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(12, 192, __pyx_L1_error)

    /* "asyncpg/protocol/codecs/range.pyx":191
 *         return []
 * 
 *     if nelems < 0:             # <<<<<<<<<<<<<<
 *         raise exceptions.ProtocolError(
 *             'unexpected multirange size value: {}'.format(nelems))
*/
  }

  /* "asyncpg/protocol/codecs/range.pyx":195
 *             'unexpected multirange size value: {}'.format(nelems))
 * 
 *     result = cpython.PyList_New(nelems)             # <<<<<<<<<<<<<<
 *     for i in range(nelems):
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
*/
  __pyx_t_3 = PyList_New(__pyx_v_nelems); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":196
 * 
 *     result = cpython.PyList_New(nelems)
 *     for i in range(nelems):             # <<<<<<<<<<<<<<
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:
*/
  __pyx_t_10 = __pyx_v_nelems;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "asyncpg/protocol/codecs/range.pyx":197
 *     result = cpython.PyList_New(nelems)
 *     for i in range(nelems):
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if elem_len == -1:
 *             raise exceptions.ProtocolError(
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(12, 197, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/range.pyx":198
 *     for i in range(nelems):
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'unexpected NULL element in multirange value')
*/
    __pyx_t_2 = (__pyx_v_elem_len == -1L);
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/codecs/range.pyx":199
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:
 *             raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *                 'unexpected NULL element in multirange value')
 *         else:
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_unexpected_NULL_element_in_multi};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(12, 199, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/range.pyx":198
 *     for i in range(nelems):
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'unexpected NULL element in multirange value')
*/
    }

    /* "asyncpg/protocol/codecs/range.pyx":202
 *                 'unexpected NULL element in multirange value')
 *         else:
 *             frb_slice_from(&elem_buf, buf, elem_len)             # <<<<<<<<<<<<<<
 *         elem = range_decode(settings, &elem_buf, decoder, decoder_arg)
 *         cpython.Py_INCREF(elem)
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_13 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 202, __pyx_L1_error)
    }

    /* "asyncpg/protocol/codecs/range.pyx":203
 *         else:
 *             frb_slice_from(&elem_buf, buf, elem_len)
 *         elem = range_decode(settings, &elem_buf, decoder, decoder_arg)             # <<<<<<<<<<<<<<
 *         cpython.Py_INCREF(elem)
 *         cpython.PyList_SET_ITEM(result, i, elem)
*/
    __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_range_decode(__pyx_v_settings, (&__pyx_v_elem_buf), __pyx_v_decoder, __pyx_v_decoder_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/codecs/range.pyx":204
 *             frb_slice_from(&elem_buf, buf, elem_len)
 *         elem = range_decode(settings, &elem_buf, decoder, decoder_arg)
 *         cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *         cpython.PyList_SET_ITEM(result, i, elem)
 * 
*/
    Py_INCREF(__pyx_v_elem);

    /* "asyncpg/protocol/codecs/range.pyx":205
 *         elem = range_decode(settings, &elem_buf, decoder, decoder_arg)
 *         cpython.Py_INCREF(elem)
 *         cpython.PyList_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "asyncpg/protocol/codecs/range.pyx":207
 *         cpython.PyList_SET_ITEM(result, i, elem)
 * 
 *     return result             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/range.pyx":179
 * 
 * 
 * cdef multirange_decode(ConnectionSettings settings, FRBuffer *buf,             # <<<<<<<<<<<<<<
 *                        decode_func_ex decoder, const void *decoder_arg):
 *     cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.multirange_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/record.pyx":11
 * 
 * 
 * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                                 WriteBuffer elem_data, int32_t elem_count):
 *     buf.write_int32(4 + elem_data.len())
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_record_encode_frame(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data, int32_t __pyx_v_elem_count) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int32_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("record_encode_frame", 0);

  /* "asyncpg/protocol/codecs/record.pyx":13
 * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf,
 *                                 WriteBuffer elem_data, int32_t elem_count):
 *     buf.write_int32(4 + elem_data.len())             # <<<<<<<<<<<<<<
 *     # attribute count
 *     buf.write_int32(elem_count)
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_AddCObj(__pyx_mstate_global->__pyx_int_4, __pyx_t_1, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(13, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":15
 *     buf.write_int32(4 + elem_data.len())
 *     # attribute count
 *     buf.write_int32(elem_count)             # <<<<<<<<<<<<<<
 *     # encoded attribute data
 *     buf.write_buffer(elem_data)
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":17
 *     buf.write_int32(elem_count)
 *     # encoded attribute data
 *     buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":11
 * 
 * 
 * cdef inline record_encode_frame(ConnectionSettings settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                                 WriteBuffer elem_data, int32_t elem_count):
 *     buf.write_int32(4 + elem_data.len())
*/

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

/* "asyncpg/protocol/codecs/record.pyx":20
 * 
 * 
 * cdef anonymous_record_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         tuple result
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  uint32_t __pyx_v_elem_typ;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_elem_codec = 0;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("anonymous_record_decode", 0);

  /* "asyncpg/protocol/codecs/record.pyx":30
 *         FRBuffer elem_buf
 * 
 *     elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     result = cpython.PyTuple_New(elem_count)
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(13, 30, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "asyncpg/protocol/codecs/record.pyx":31
 * 
 *     elem_count = <ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *     result = cpython.PyTuple_New(elem_count)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(elem_count):
*/
  __pyx_t_2 = PyTuple_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":33
 *     result = cpython.PyTuple_New(elem_count)
 * 
 *     for i in range(elem_count):             # <<<<<<<<<<<<<<
 *         elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
*/
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "asyncpg/protocol/codecs/record.pyx":34
 * 
 *     for i in range(elem_count):
 *         elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(13, 34, __pyx_L1_error)
    __pyx_v_elem_typ = ((uint32_t)unpack_int32(__pyx_t_1));

    /* "asyncpg/protocol/codecs/record.pyx":35
 *     for i in range(elem_count):
 *         elem_typ = <uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *         if elem_len == -1:
*/
    __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(13, 35, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "asyncpg/protocol/codecs/record.pyx":37
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             elem = None
 *         else:
*/
    __pyx_t_6 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_6) {

      /* "asyncpg/protocol/codecs/record.pyx":38
 * 
 *         if elem_len == -1:
 *             elem = None             # <<<<<<<<<<<<<<
 *         else:
 *             elem_codec = settings.get_data_codec(elem_typ)
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "asyncpg/protocol/codecs/record.pyx":37
 *         elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_len == -1:             # <<<<<<<<<<<<<<
 *             elem = None
 *         else:
*/
      goto __pyx_L5;
    }

    /* "asyncpg/protocol/codecs/record.pyx":40
 *             elem = None
 *         else:
 *             elem_codec = settings.get_data_codec(elem_typ)             # <<<<<<<<<<<<<<
 *             if elem_codec is None or not elem_codec.has_decoder():
 *                 raise exceptions.InternalClientError(
*/
    /*else*/ {
      __pyx_t_2 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_settings, __pyx_v_elem_typ, 0, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 40, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/codecs/record.pyx":41
 *         else:
 *             elem_codec = settings.get_data_codec(elem_typ)
 *             if elem_codec is None or not elem_codec.has_decoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for composite type element in '
*/
      __pyx_t_7 = (((PyObject *)__pyx_v_elem_codec) == Py_None);
      if (!__pyx_t_7) {
      } else {
        __pyx_t_6 = __pyx_t_7;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_elem_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 41, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(13, 41, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = (!__pyx_t_7);
      __pyx_t_6 = __pyx_t_8;
      __pyx_L7_bool_binop_done:;
      if (unlikely(__pyx_t_6)) {

        /* "asyncpg/protocol/codecs/record.pyx":42
 *             elem_codec = settings.get_data_codec(elem_typ)
 *             if elem_codec is None or not elem_codec.has_decoder():
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'no decoder for composite type element in '
 *                     'position {} of type OID {}'.format(i, elem_typ))
*/
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 42, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 42, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "asyncpg/protocol/codecs/record.pyx":44
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for composite type element in '
 *                     'position {} of type OID {}'.format(i, elem_typ))             # <<<<<<<<<<<<<<
 *             elem = elem_codec.decode(settings,
 *                                      frb_slice_from(&elem_buf, buf, elem_len))
*/
        __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_no_decoder_for_composite_type_el;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_13 = PyLong_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) __PYX_ERR(13, 44, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyLong_From_uint32_t(__pyx_v_elem_typ); if (unlikely(!__pyx_t_14)) __PYX_ERR(13, 44, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_13, __pyx_t_14};
          __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 44, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        }
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 42, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(13, 42, __pyx_L1_error)

        /* "asyncpg/protocol/codecs/record.pyx":41
 *         else:
 *             elem_codec = settings.get_data_codec(elem_typ)
 *             if elem_codec is None or not elem_codec.has_decoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for composite type element in '
*/
      }

      /* "asyncpg/protocol/codecs/record.pyx":46
 *                     'position {} of type OID {}'.format(i, elem_typ))
 *             elem = elem_codec.decode(settings,
 *                                      frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 * 
 *         cpython.Py_INCREF(elem)
*/
      __pyx_t_16 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_16 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 46, __pyx_L1_error)

      /* "asyncpg/protocol/codecs/record.pyx":45
 *                     'no decoder for composite type element in '
 *                     'position {} of type OID {}'.format(i, elem_typ))
 *             elem = elem_codec.decode(settings,             # <<<<<<<<<<<<<<
 *                                      frb_slice_from(&elem_buf, buf, elem_len))
 * 
*/
      __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_elem_codec, __pyx_v_settings, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "asyncpg/protocol/codecs/record.pyx":48
 *                                      frb_slice_from(&elem_buf, buf, elem_len))
 * 
 *         cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *         cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
*/
    Py_INCREF(__pyx_v_elem);

    /* "asyncpg/protocol/codecs/record.pyx":49
 * 
 *         cpython.Py_INCREF(elem)
 *         cpython.PyTuple_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "asyncpg/protocol/codecs/record.pyx":51
 *         cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/codecs/record.pyx":20
 * 
 * 
 * cdef anonymous_record_decode(ConnectionSettings settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         tuple result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.anonymous_record_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/record.pyx":54
 * 
 * 
 * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     raise exceptions.UnsupportedClientFeatureError(
 *         'input of anonymous composite types is not supported',
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings, CYTHON_UNUSED struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("anonymous_record_encode", 0);

  /* "asyncpg/protocol/codecs/record.pyx":55
 * 
 * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj):
 *     raise exceptions.UnsupportedClientFeatureError(             # <<<<<<<<<<<<<<
 *         'input of anonymous composite types is not supported',
 *         hint=(
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnsupportedClientFeatureError); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_input_of_anonymous_composite_typ};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hint, __pyx_mstate_global->__pyx_kp_u_Consider_declaring_an_explicit_c, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(13, 55, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_detail, __pyx_mstate_global->__pyx_kp_u_PostgreSQL_does_not_implement_an, __pyx_t_3, __pyx_callargs+2, 1) < (0)) __PYX_ERR(13, 55, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(13, 55, __pyx_L1_error)

  /* "asyncpg/protocol/codecs/record.pyx":54
 * 
 * 
 * cdef anonymous_record_encode(ConnectionSettings settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     raise exceptions.UnsupportedClientFeatureError(
 *         'input of anonymous composite types is not supported',
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.anonymous_record_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/codecs/record.pyx":65
 * 
 * 
 * cdef init_record_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(RECORDOID,
 *                         <encode_func>anonymous_record_encode,
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init_record_codecs", 0);

  /* "asyncpg/protocol/codecs/record.pyx":66
 * 
 * cdef init_record_codecs():
 *     register_core_codec(RECORDOID,             # <<<<<<<<<<<<<<
 *                         <encode_func>anonymous_record_encode,
 *                         <decode_func>anonymous_record_decode,
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_register_core_codec(0x8C9, ((__pyx_t_7asyncpg_8protocol_8protocol_encode_func)__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_encode), ((__pyx_t_7asyncpg_8protocol_8protocol_decode_func)__pyx_f_7asyncpg_8protocol_8protocol_anonymous_record_decode), __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":65
 * 
 * 
 * cdef init_record_codecs():             # <<<<<<<<<<<<<<
 *     register_core_codec(RECORDOID,
 *                         <encode_func>anonymous_record_encode,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.init_record_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":93
 *     )
 * 
 *     def __cinit__(self, bytes authentication_method):             # <<<<<<<<<<<<<<
 *         self.authentication_method = authentication_method
 *         self.authorization_message = None
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_authentication_method = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_authentication_method,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 93, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 93, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(3, 93, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(3, 93, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 93, __pyx_L3_error)
    }
    __pyx_v_authentication_method = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 93, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_authentication_method), (&PyBytes_Type), 1, "authentication_method", 1))) __PYX_ERR(3, 93, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self), __pyx_v_authentication_method);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_authentication_method) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asyncpg/protocol/scram.pyx":94
 * 
 *     def __cinit__(self, bytes authentication_method):
 *         self.authentication_method = authentication_method             # <<<<<<<<<<<<<<
 *         self.authorization_message = None
 *         # channel binding is turned off for the time being
*/
  __Pyx_INCREF(__pyx_v_authentication_method);
  __Pyx_GIVEREF(__pyx_v_authentication_method);
  __Pyx_GOTREF(__pyx_v_self->authentication_method);
  __Pyx_DECREF(__pyx_v_self->authentication_method);
  __pyx_v_self->authentication_method = __pyx_v_authentication_method;

  /* "asyncpg/protocol/scram.pyx":95
 *     def __cinit__(self, bytes authentication_method):
 *         self.authentication_method = authentication_method
 *         self.authorization_message = None             # <<<<<<<<<<<<<<
 *         # channel binding is turned off for the time being
 *         self.client_channel_binding = b"n,,"
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->authorization_message);
  __Pyx_DECREF(__pyx_v_self->authorization_message);
  __pyx_v_self->authorization_message = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":97
 *         self.authorization_message = None
 *         # channel binding is turned off for the time being
 *         self.client_channel_binding = b"n,,"             # <<<<<<<<<<<<<<
 *         self.client_first_message_bare = None
 *         self.client_nonce = None
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_n);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_n);
  __Pyx_GOTREF(__pyx_v_self->client_channel_binding);
  __Pyx_DECREF(__pyx_v_self->client_channel_binding);
  __pyx_v_self->client_channel_binding = __pyx_mstate_global->__pyx_kp_b_n;

  /* "asyncpg/protocol/scram.pyx":98
 *         # channel binding is turned off for the time being
 *         self.client_channel_binding = b"n,,"
 *         self.client_first_message_bare = None             # <<<<<<<<<<<<<<
 *         self.client_nonce = None
 *         self.client_proof = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client_first_message_bare);
  __Pyx_DECREF(__pyx_v_self->client_first_message_bare);
  __pyx_v_self->client_first_message_bare = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":99
 *         self.client_channel_binding = b"n,,"
 *         self.client_first_message_bare = None
 *         self.client_nonce = None             # <<<<<<<<<<<<<<
 *         self.client_proof = None
 *         self.password_salt = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client_nonce);
  __Pyx_DECREF(__pyx_v_self->client_nonce);
  __pyx_v_self->client_nonce = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":100
 *         self.client_first_message_bare = None
 *         self.client_nonce = None
 *         self.client_proof = None             # <<<<<<<<<<<<<<
 *         self.password_salt = None
 *         # self.password_iterations = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->client_proof);
  __Pyx_DECREF(__pyx_v_self->client_proof);
  __pyx_v_self->client_proof = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":101
 *         self.client_nonce = None
 *         self.client_proof = None
 *         self.password_salt = None             # <<<<<<<<<<<<<<
 *         # self.password_iterations = None
 *         self.server_first_message = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->password_salt);
  __Pyx_DECREF(__pyx_v_self->password_salt);
  __pyx_v_self->password_salt = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":103
 *         self.password_salt = None
 *         # self.password_iterations = None
 *         self.server_first_message = None             # <<<<<<<<<<<<<<
 *         self.server_key = None
 *         self.server_nonce = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->server_first_message);
  __Pyx_DECREF(__pyx_v_self->server_first_message);
  __pyx_v_self->server_first_message = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":104
 *         # self.password_iterations = None
 *         self.server_first_message = None
 *         self.server_key = None             # <<<<<<<<<<<<<<
 *         self.server_nonce = None
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->server_key);
  __Pyx_DECREF(__pyx_v_self->server_key);
  __pyx_v_self->server_key = Py_None;

  /* "asyncpg/protocol/scram.pyx":105
 *         self.server_first_message = None
 *         self.server_key = None
 *         self.server_nonce = None             # <<<<<<<<<<<<<<
 * 
 *     cdef create_client_first_message(self, str username):
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->server_nonce);
  __Pyx_DECREF(__pyx_v_self->server_nonce);
  __pyx_v_self->server_nonce = ((PyObject*)Py_None);

  /* "asyncpg/protocol/scram.pyx":93
 *     )
 * 
 *     def __cinit__(self, bytes authentication_method):             # <<<<<<<<<<<<<<
 *         self.authentication_method = authentication_method
 *         self.authorization_message = None
*/

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

/* "asyncpg/protocol/scram.pyx":107
 *         self.server_nonce = None
 * 
 *     cdef create_client_first_message(self, str username):             # <<<<<<<<<<<<<<
 *         """Create the initial client message for SCRAM authentication"""
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_username) {
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_client_first_message = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_client_first_message", 0);

  /* "asyncpg/protocol/scram.pyx":114
 * 
 *         self.client_nonce = \
 *             self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES)             # <<<<<<<<<<<<<<
 *         # set the client first message bare here, as it's used in a later step
 *         self.client_first_message_bare =  b"n=" + username.encode("utf-8") + \
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 114, __pyx_L1_error)

  /* "asyncpg/protocol/scram.pyx":113
 *             bytes client_first_message
 * 
 *         self.client_nonce = \             # <<<<<<<<<<<<<<
 *             self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES)
 *         # set the client first message bare here, as it's used in a later step
*/
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->client_nonce);
  __Pyx_DECREF(__pyx_v_self->client_nonce);
  __pyx_v_self->client_nonce = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":116
 *             self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES)
 *         # set the client first message bare here, as it's used in a later step
 *         self.client_first_message_bare =  b"n=" + username.encode("utf-8") + \             # <<<<<<<<<<<<<<
 *             b",r=" + self.client_nonce
 *         # put together the full message here
*/
  if (unlikely(__pyx_v_username == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
    __PYX_ERR(3, 116, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_b_n_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":117
 *         # set the client first message bare here, as it's used in a later step
 *         self.client_first_message_bare =  b"n=" + username.encode("utf-8") + \
 *             b",r=" + self.client_nonce             # <<<<<<<<<<<<<<
 *         # put together the full message here
 *         msg = bytes()
*/
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_self->client_nonce); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":116
 *             self._generate_client_nonce(self.DEFAULT_CLIENT_NONCE_BYTES)
 *         # set the client first message bare here, as it's used in a later step
 *         self.client_first_message_bare =  b"n=" + username.encode("utf-8") + \             # <<<<<<<<<<<<<<
 *             b",r=" + self.client_nonce
 *         # put together the full message here
*/
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->client_first_message_bare);
  __Pyx_DECREF(__pyx_v_self->client_first_message_bare);
  __pyx_v_self->client_first_message_bare = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":119
 *             b",r=" + self.client_nonce
 *         # put together the full message here
 *         msg = bytes()             # <<<<<<<<<<<<<<
 *         msg += self.authentication_method + b"\0"
 *         client_first_message = self.client_channel_binding + \
*/
  __pyx_t_1 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_msg = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":120
 *         # put together the full message here
 *         msg = bytes()
 *         msg += self.authentication_method + b"\0"             # <<<<<<<<<<<<<<
 *         client_first_message = self.client_channel_binding + \
 *             self.client_first_message_bare
*/
  __pyx_t_3 = PyNumber_Add(__pyx_v_self->authentication_method, __pyx_mstate_global->__pyx_kp_b__11); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":121
 *         msg = bytes()
 *         msg += self.authentication_method + b"\0"
 *         client_first_message = self.client_channel_binding + \             # <<<<<<<<<<<<<<
 *             self.client_first_message_bare
 *         msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \
*/
  __pyx_t_1 = PyNumber_Add(__pyx_v_self->client_channel_binding, __pyx_v_self->client_first_message_bare); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_client_first_message = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":123
 *         client_first_message = self.client_channel_binding + \
 *             self.client_first_message_bare
 *         msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \             # <<<<<<<<<<<<<<
 *             client_first_message
 *         return msg
*/
  __pyx_t_5 = __Pyx_PyBytes_GET_SIZE(__pyx_v_client_first_message); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 123, __pyx_L1_error)
  __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __pyx_t_6;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_4};
    __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_byteorder, __pyx_mstate_global->__pyx_n_u_big, __pyx_t_7, __pyx_callargs+2, 0) < (0)) __PYX_ERR(3, 123, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_to_bytes, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "asyncpg/protocol/scram.pyx":124
 *             self.client_first_message_bare
 *         msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \
 *             client_first_message             # <<<<<<<<<<<<<<
 *         return msg
 * 
*/
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_client_first_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":123
 *         client_first_message = self.client_channel_binding + \
 *             self.client_first_message_bare
 *         msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \             # <<<<<<<<<<<<<<
 *             client_first_message
 *         return msg
*/
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 123, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":125
 *         msg += (len(client_first_message)).to_bytes(4, byteorder='big') + \
 *             client_first_message
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef create_client_final_message(self, str password):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":107
 *         self.server_nonce = None
 * 
 *     cdef create_client_first_message(self, str username):             # <<<<<<<<<<<<<<
 *         """Create the initial client message for SCRAM authentication"""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.create_client_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_client_first_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":127
 *         return msg
 * 
 *     cdef create_client_final_message(self, str password):             # <<<<<<<<<<<<<<
 *         """Create the final client message as part of SCRAM authentication"""
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password) {
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_8genexpr2__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_client_final_message", 0);
  __Pyx_INCREF(__pyx_v_password);

  /* "asyncpg/protocol/scram.pyx":132
 *             bytes msg
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]):
 *             raise Exception(
*/
  __pyx_t_2 = NULL;
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 132, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asyncpg/protocol/scram.pyx":133
 * 
 *         if any([getattr(self, val) is None for val in
 *                 self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]):             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 "you need values from server to generate a client proof")
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 133, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 133, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 133, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 133, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 133, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 133, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 133, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_val, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/scram.pyx":132
 *             bytes msg
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]):
 *             raise Exception(
*/
      __pyx_t_4 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr2__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 132, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_t_4 == Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 132, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 132, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val); __pyx_8genexpr2__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_any, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_8)) {

    /* "asyncpg/protocol/scram.pyx":134
 *         if any([getattr(self, val) is None for val in
 *                 self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]):
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 "you need values from server to generate a client proof")
 * 
*/
    __pyx_t_3 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_you_need_values_from_server_to_g};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 134, __pyx_L1_error)

    /* "asyncpg/protocol/scram.pyx":132
 *             bytes msg
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_FINAL_MESSAGE]):
 *             raise Exception(
*/
  }

  /* "asyncpg/protocol/scram.pyx":138
 * 
 *         # normalize the password using the SASLprep algorithm in RFC 4013
 *         password = self._normalize_password(password)             # <<<<<<<<<<<<<<
 * 
 *         # generate the client proof
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(3, 138, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_password, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":141
 * 
 *         # generate the client proof
 *         self.client_proof = self._generate_client_proof(password=password)             # <<<<<<<<<<<<<<
 *         msg = bytes()
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(__pyx_v_self, __pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 141, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->client_proof);
  __Pyx_DECREF(__pyx_v_self->client_proof);
  __pyx_v_self->client_proof = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":142
 *         # generate the client proof
 *         self.client_proof = self._generate_client_proof(password=password)
 *         msg = bytes()             # <<<<<<<<<<<<<<
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \
 *             b",r=" + self.server_nonce + \
*/
  __pyx_t_3 = NULL;
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_msg = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":143
 *         self.client_proof = self._generate_client_proof(password=password)
 *         msg = bytes()
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \             # <<<<<<<<<<<<<<
 *             b",r=" + self.server_nonce + \
 *             b",p=" + base64.b64encode(self.client_proof)
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->client_channel_binding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_b_c_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/scram.pyx":144
 *         msg = bytes()
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \
 *             b",r=" + self.server_nonce + \             # <<<<<<<<<<<<<<
 *             b",p=" + base64.b64encode(self.client_proof)
 *         return msg
*/
  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/scram.pyx":145
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \
 *             b",r=" + self.server_nonce + \
 *             b",p=" + base64.b64encode(self.client_proof)             # <<<<<<<<<<<<<<
 *         return msg
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->client_proof};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/scram.pyx":143
 *         self.client_proof = self._generate_client_proof(password=password)
 *         msg = bytes()
 *         msg += b"c=" + base64.b64encode(self.client_channel_binding) + \             # <<<<<<<<<<<<<<
 *             b",r=" + self.server_nonce + \
 *             b",p=" + base64.b64encode(self.client_proof)
*/
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_5));
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/scram.pyx":146
 *             b",r=" + self.server_nonce + \
 *             b",p=" + base64.b64encode(self.client_proof)
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_server_first_message(self, bytes server_response):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":127
 *         return msg
 * 
 *     cdef create_client_final_message(self, str password):             # <<<<<<<<<<<<<<
 *         """Create the final client message as part of SCRAM authentication"""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.create_client_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_password);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":148
 *         return msg
 * 
 *     cdef parse_server_first_message(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_response) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_server_first_message", 0);

  /* "asyncpg/protocol/scram.pyx":150
 *     cdef parse_server_first_message(self, bytes server_response):
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response             # <<<<<<<<<<<<<<
 *         try:
 *             self.server_nonce = re.search(b'r=([^,]+),',
*/
  __Pyx_INCREF(__pyx_v_server_response);
  __Pyx_GIVEREF(__pyx_v_server_response);
  __Pyx_GOTREF(__pyx_v_self->server_first_message);
  __Pyx_DECREF(__pyx_v_self->server_first_message);
  __pyx_v_self->server_first_message = __pyx_v_server_response;

  /* "asyncpg/protocol/scram.pyx":151
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response
 *         try:             # <<<<<<<<<<<<<<
 *             self.server_nonce = re.search(b'r=([^,]+),',
 *                 self.server_first_message).group(1)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/scram.pyx":152
 *         self.server_first_message = server_response
 *         try:
 *             self.server_nonce = re.search(b'r=([^,]+),',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1)
 *         except IndexError:
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 152, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 152, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/scram.pyx":153
 *         try:
 *             self.server_nonce = re.search(b'r=([^,]+),',
 *                 self.server_first_message).group(1)             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             raise Exception("could not get nonce")
*/
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_b_r_3, __pyx_v_self->server_first_message};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 152, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_5 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 153, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(3, 153, __pyx_L3_error)

      /* "asyncpg/protocol/scram.pyx":152
 *         self.server_first_message = server_response
 *         try:
 *             self.server_nonce = re.search(b'r=([^,]+),',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1)
 *         except IndexError:
*/
      __Pyx_GIVEREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_v_self->server_nonce);
      __Pyx_DECREF(__pyx_v_self->server_nonce);
      __pyx_v_self->server_nonce = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/scram.pyx":151
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response
 *         try:             # <<<<<<<<<<<<<<
 *             self.server_nonce = re.search(b'r=([^,]+),',
 *                 self.server_first_message).group(1)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "asyncpg/protocol/scram.pyx":154
 *             self.server_nonce = re.search(b'r=([^,]+),',
 *                 self.server_first_message).group(1)
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             raise Exception("could not get nonce")
 *         if not self.server_nonce.startswith(self.client_nonce):
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError))));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(3, 154, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "asyncpg/protocol/scram.pyx":155
 *                 self.server_first_message).group(1)
 *         except IndexError:
 *             raise Exception("could not get nonce")             # <<<<<<<<<<<<<<
 *         if not self.server_nonce.startswith(self.client_nonce):
 *             raise Exception("invalid nonce")
*/
      __pyx_t_7 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_could_not_get_nonce};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 155, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(3, 155, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/scram.pyx":151
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response
 *         try:             # <<<<<<<<<<<<<<
 *             self.server_nonce = re.search(b'r=([^,]+),',
 *                 self.server_first_message).group(1)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/scram.pyx":156
 *         except IndexError:
 *             raise Exception("could not get nonce")
 *         if not self.server_nonce.startswith(self.client_nonce):             # <<<<<<<<<<<<<<
 *             raise Exception("invalid nonce")
 *         try:
*/
  if (unlikely(__pyx_v_self->server_nonce == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith");
    __PYX_ERR(3, 156, __pyx_L1_error)
  }
  __pyx_t_12 = __Pyx_PyBytes_Tailmatch(__pyx_v_self->server_nonce, __pyx_v_self->client_nonce, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(3, 156, __pyx_L1_error)
  __pyx_t_13 = (!__pyx_t_12);
  if (unlikely(__pyx_t_13)) {

    /* "asyncpg/protocol/scram.pyx":157
 *             raise Exception("could not get nonce")
 *         if not self.server_nonce.startswith(self.client_nonce):
 *             raise Exception("invalid nonce")             # <<<<<<<<<<<<<<
 *         try:
 *             self.password_salt = re.search(b',s=([^,]+),',
*/
    __pyx_t_6 = NULL;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_invalid_nonce};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(3, 157, __pyx_L1_error)

    /* "asyncpg/protocol/scram.pyx":156
 *         except IndexError:
 *             raise Exception("could not get nonce")
 *         if not self.server_nonce.startswith(self.client_nonce):             # <<<<<<<<<<<<<<
 *             raise Exception("invalid nonce")
 *         try:
*/
  }

  /* "asyncpg/protocol/scram.pyx":158
 *         if not self.server_nonce.startswith(self.client_nonce):
 *             raise Exception("invalid nonce")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_salt = re.search(b',s=([^,]+),',
 *                 self.server_first_message).group(1)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "asyncpg/protocol/scram.pyx":159
 *             raise Exception("invalid nonce")
 *         try:
 *             self.password_salt = re.search(b',s=([^,]+),',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1)
 *         except IndexError:
*/
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 159, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 159, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "asyncpg/protocol/scram.pyx":160
 *         try:
 *             self.password_salt = re.search(b',s=([^,]+),',
 *                 self.server_first_message).group(1)             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             raise Exception("could not get salt")
*/
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_b_s, __pyx_v_self->server_first_message};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 159, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_6 = __pyx_t_4;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_1};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 160, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 160, __pyx_L12_error)

      /* "asyncpg/protocol/scram.pyx":159
 *             raise Exception("invalid nonce")
 *         try:
 *             self.password_salt = re.search(b',s=([^,]+),',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1)
 *         except IndexError:
*/
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->password_salt);
      __Pyx_DECREF(__pyx_v_self->password_salt);
      __pyx_v_self->password_salt = ((PyObject*)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "asyncpg/protocol/scram.pyx":158
 *         if not self.server_nonce.startswith(self.client_nonce):
 *             raise Exception("invalid nonce")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_salt = re.search(b',s=([^,]+),',
 *                 self.server_first_message).group(1)
*/
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "asyncpg/protocol/scram.pyx":161
 *             self.password_salt = re.search(b',s=([^,]+),',
 *                 self.server_first_message).group(1)
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             raise Exception("could not get salt")
 *         try:
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError))));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(3, 161, __pyx_L14_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);

      /* "asyncpg/protocol/scram.pyx":162
 *                 self.server_first_message).group(1)
 *         except IndexError:
 *             raise Exception("could not get salt")             # <<<<<<<<<<<<<<
 *         try:
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_could_not_get_salt};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 162, __pyx_L14_except_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(3, 162, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;

    /* "asyncpg/protocol/scram.pyx":158
 *         if not self.server_nonce.startswith(self.client_nonce):
 *             raise Exception("invalid nonce")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_salt = re.search(b',s=([^,]+),',
 *                 self.server_first_message).group(1)
*/
    __pyx_L14_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "asyncpg/protocol/scram.pyx":163
 *         except IndexError:
 *             raise Exception("could not get salt")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
 *                 self.server_first_message).group(1))
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/scram.pyx":164
 *             raise Exception("could not get salt")
 *         try:
 *             self.password_iterations = int(re.search(b',i=(\d+),?',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1))
 *         except (IndexError, TypeError, ValueError):
*/
      __pyx_t_8 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 164, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 164, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "asyncpg/protocol/scram.pyx":165
 *         try:
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
 *                 self.server_first_message).group(1))             # <<<<<<<<<<<<<<
 *         except (IndexError, TypeError, ValueError):
 *             raise Exception("could not get iterations")
*/
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_8);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_b_i_d, __pyx_v_self->server_first_message};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 164, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_4 = __pyx_t_5;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_int_1};
        __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 165, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_6);
      }

      /* "asyncpg/protocol/scram.pyx":164
 *             raise Exception("could not get salt")
 *         try:
 *             self.password_iterations = int(re.search(b',i=(\d+),?',             # <<<<<<<<<<<<<<
 *                 self.server_first_message).group(1))
 *         except (IndexError, TypeError, ValueError):
*/
      __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 164, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 164, __pyx_L20_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_self->password_iterations = __pyx_t_11;

      /* "asyncpg/protocol/scram.pyx":163
 *         except IndexError:
 *             raise Exception("could not get salt")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
 *                 self.server_first_message).group(1))
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "asyncpg/protocol/scram.pyx":166
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
 *                 self.server_first_message).group(1))
 *         except (IndexError, TypeError, ValueError):             # <<<<<<<<<<<<<<
 *             raise Exception("could not get iterations")
 * 
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError)))) || __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError)))) || __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(3, 166, __pyx_L22_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "asyncpg/protocol/scram.pyx":167
 *                 self.server_first_message).group(1))
 *         except (IndexError, TypeError, ValueError):
 *             raise Exception("could not get iterations")             # <<<<<<<<<<<<<<
 * 
 *     cdef verify_server_final_message(self, bytes server_final_message):
*/
      __pyx_t_8 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_could_not_get_iterations};
        __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 167, __pyx_L22_except_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(3, 167, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;

    /* "asyncpg/protocol/scram.pyx":163
 *         except IndexError:
 *             raise Exception("could not get salt")
 *         try:             # <<<<<<<<<<<<<<
 *             self.password_iterations = int(re.search(b',i=(\d+),?',
 *                 self.server_first_message).group(1))
*/
    __pyx_L22_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "asyncpg/protocol/scram.pyx":148
 *         return msg
 * 
 *     cdef parse_server_first_message(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         """Parse the response from the first message from the server"""
 *         self.server_first_message = server_response
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.parse_server_first_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":169
 *             raise Exception("could not get iterations")
 * 
 *     cdef verify_server_final_message(self, bytes server_final_message):             # <<<<<<<<<<<<<<
 *         """Verify the final message from the server"""
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_server_final_message) {
  PyObject *__pyx_v_server_signature = 0;
  PyObject *__pyx_v_verify_server_signature = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("verify_server_final_message", 0);

  /* "asyncpg/protocol/scram.pyx":174
 *             bytes server_signature
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             server_signature = re.search(b'v=([^,]+)',
 *                 server_final_message).group(1)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/scram.pyx":175
 * 
 *         try:
 *             server_signature = re.search(b'v=([^,]+)',             # <<<<<<<<<<<<<<
 *                 server_final_message).group(1)
 *         except IndexError:
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 175, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 175, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/scram.pyx":176
 *         try:
 *             server_signature = re.search(b'v=([^,]+)',
 *                 server_final_message).group(1)             # <<<<<<<<<<<<<<
 *         except IndexError:
 *             raise Exception("could not get server signature")
*/
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_b_v, __pyx_v_server_final_message};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 175, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_5 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_int_1};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 176, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(3, 176, __pyx_L3_error)
      __pyx_v_server_signature = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/scram.pyx":174
 *             bytes server_signature
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             server_signature = re.search(b'v=([^,]+)',
 *                 server_final_message).group(1)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "asyncpg/protocol/scram.pyx":177
 *             server_signature = re.search(b'v=([^,]+)',
 *                 server_final_message).group(1)
 *         except IndexError:             # <<<<<<<<<<<<<<
 *             raise Exception("could not get server signature")
 * 
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_IndexError))));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.verify_server_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(3, 177, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "asyncpg/protocol/scram.pyx":178
 *                 server_final_message).group(1)
 *         except IndexError:
 *             raise Exception("could not get server signature")             # <<<<<<<<<<<<<<
 * 
 *         verify_server_signature = hmac.new(self.server_key.digest(),
*/
      __pyx_t_7 = NULL;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_could_not_get_server_signature};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 178, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(3, 178, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/scram.pyx":174
 *             bytes server_signature
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             server_signature = re.search(b'v=([^,]+)',
 *                 server_final_message).group(1)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/scram.pyx":180
 *             raise Exception("could not get server signature")
 * 
 *         verify_server_signature = hmac.new(self.server_key.digest(),             # <<<<<<<<<<<<<<
 *             self.authorization_message, self.DIGEST)
 *         # validate the server signature against the verifier
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_v_self->server_key;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }

  /* "asyncpg/protocol/scram.pyx":181
 * 
 *         verify_server_signature = hmac.new(self.server_key.digest(),
 *             self.authorization_message, self.DIGEST)             # <<<<<<<<<<<<<<
 *         # validate the server signature against the verifier
 *         return server_signature == base64.b64encode(
*/
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->authorization_message, __pyx_t_7};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_v_verify_server_signature = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/scram.pyx":183
 *             self.authorization_message, self.DIGEST)
 *         # validate the server signature against the verifier
 *         return server_signature == base64.b64encode(             # <<<<<<<<<<<<<<
 *             verify_server_signature.digest())
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "asyncpg/protocol/scram.pyx":184
 *         # validate the server signature against the verifier
 *         return server_signature == base64.b64encode(
 *             verify_server_signature.digest())             # <<<<<<<<<<<<<<
 * 
 *     cdef _bytes_xor(self, bytes a, bytes b):
*/
  __pyx_t_6 = __pyx_v_verify_server_signature;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_9);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_server_signature, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":169
 *             raise Exception("could not get iterations")
 * 
 *     cdef verify_server_final_message(self, bytes server_final_message):             # <<<<<<<<<<<<<<
 *         """Verify the final message from the server"""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.verify_server_final_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_server_signature);
  __Pyx_XDECREF(__pyx_v_verify_server_signature);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/scram.pyx":188
 *     cdef _bytes_xor(self, bytes a, bytes b):
 *         """XOR two bytestrings together"""
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))             # <<<<<<<<<<<<<<
 * 
 *     cdef _generate_client_nonce(self, int num_bytes):
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 188, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__bytes_xor_l, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(3, 188, __pyx_L1_error)
  }
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 188, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 188, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 188, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 188, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 188, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 188, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 188, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 188, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < (0)) __PYX_ERR(3, 188, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 188, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_a_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_a_i, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_b_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b_i, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_4 = PyNumber_Xor(__pyx_cur_scope->__pyx_v_a_i, __pyx_cur_scope->__pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 188, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "asyncpg/protocol/scram.pyx":186
 *             verify_server_signature.digest())
 * 
 *     cdef _bytes_xor(self, bytes a, bytes b):             # <<<<<<<<<<<<<<
 *         """XOR two bytestrings together"""
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12 = 0;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bytes_xor", 0);

  /* "asyncpg/protocol/scram.pyx":188
 *     cdef _bytes_xor(self, bytes a, bytes b):
 *         """XOR two bytestrings together"""
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))             # <<<<<<<<<<<<<<
 * 
 *     cdef _generate_client_nonce(self, int num_bytes):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_a, __pyx_v_b};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":186
 *             verify_server_signature.digest())
 * 
 *     cdef _bytes_xor(self, bytes a, bytes b):             # <<<<<<<<<<<<<<
 *         """XOR two bytestrings together"""
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._bytes_xor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10_bytes_xor_2generator12);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":190
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))
 * 
 *     cdef _generate_client_nonce(self, int num_bytes):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes token
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, int __pyx_v_num_bytes) {
  PyObject *__pyx_v_token = 0;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_generate_client_nonce", 0);

  /* "asyncpg/protocol/scram.pyx":194
 *             bytes token
 * 
 *         token = secrets.token_bytes(num_bytes)             # <<<<<<<<<<<<<<
 * 
 *         return base64.b64encode(token)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_secrets); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_token_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_num_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 194, __pyx_L1_error)
  __pyx_v_token = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":196
 *         token = secrets.token_bytes(num_bytes)
 * 
 *         return base64.b64encode(token)             # <<<<<<<<<<<<<<
 * 
 *     cdef _generate_client_proof(self, str password):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_token};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":190
 *         return bytes(a_i ^ b_i for a_i, b_i in zip(a, b))
 * 
 *     cdef _generate_client_nonce(self, int num_bytes):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes token
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_client_nonce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":198
 *         return base64.b64encode(token)
 * 
 *     cdef _generate_client_proof(self, str password):             # <<<<<<<<<<<<<<
 *         """need to ensure a server response exists, i.e. """
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password) {
  PyObject *__pyx_v_salted_password = 0;
  PyObject *__pyx_v_client_key = NULL;
  PyObject *__pyx_v_stored_key = NULL;
  PyObject *__pyx_v_client_signature = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_generate_client_proof", 0);

  /* "asyncpg/protocol/scram.pyx":203
 *             bytes salted_password
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_PROOF]):
 *             raise Exception(
*/
  __pyx_t_2 = NULL;
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 203, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asyncpg/protocol/scram.pyx":204
 * 
 *         if any([getattr(self, val) is None for val in
 *                 self.REQUIREMENTS_CLIENT_PROOF]):             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 "you need values from server to generate a client proof")
*/
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_PROOF); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 204, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 204, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 204, __pyx_L6_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 204, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_6;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 204, __pyx_L6_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6);
          #endif
          ++__pyx_t_6;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 204, __pyx_L6_error)
      } else {
        __pyx_t_4 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 204, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_val, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/scram.pyx":203
 *             bytes salted_password
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_PROOF]):
 *             raise Exception(
*/
      __pyx_t_4 = __Pyx_GetAttr(((PyObject *)__pyx_v_self), __pyx_8genexpr4__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 203, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = (__pyx_t_4 == Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 203, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 203, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val); __pyx_8genexpr4__pyx_v_val = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val); __pyx_8genexpr4__pyx_v_val = 0;
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_any, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_8)) {

    /* "asyncpg/protocol/scram.pyx":205
 *         if any([getattr(self, val) is None for val in
 *                 self.REQUIREMENTS_CLIENT_PROOF]):
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 "you need values from server to generate a client proof")
 *         # generate a salt password
*/
    __pyx_t_3 = NULL;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_you_need_values_from_server_to_g};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_Exception)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 205, __pyx_L1_error)

    /* "asyncpg/protocol/scram.pyx":203
 *             bytes salted_password
 * 
 *         if any([getattr(self, val) is None for val in             # <<<<<<<<<<<<<<
 *                 self.REQUIREMENTS_CLIENT_PROOF]):
 *             raise Exception(
*/
  }

  /* "asyncpg/protocol/scram.pyx":209
 *         # generate a salt password
 *         salted_password = self._generate_salted_password(password,
 *             self.password_salt, self.password_iterations)             # <<<<<<<<<<<<<<
 *         # client key is derived from the salted password
 *         client_key = hmac.new(salted_password, b"Client Key", self.DIGEST)
*/
  __pyx_t_1 = __pyx_v_self->password_salt;
  __Pyx_INCREF(__pyx_t_1);

  /* "asyncpg/protocol/scram.pyx":208
 *                 "you need values from server to generate a client proof")
 *         # generate a salt password
 *         salted_password = self._generate_salted_password(password,             # <<<<<<<<<<<<<<
 *             self.password_salt, self.password_iterations)
 *         # client key is derived from the salted password
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(__pyx_v_self, __pyx_v_password, ((PyObject*)__pyx_t_1), __pyx_v_self->password_iterations); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(3, 208, __pyx_L1_error)
  __pyx_v_salted_password = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":211
 *             self.password_salt, self.password_iterations)
 *         # client key is derived from the salted password
 *         client_key = hmac.new(salted_password, b"Client Key", self.DIGEST)             # <<<<<<<<<<<<<<
 *         # this allows us to compute the stored key that is residing on the server
 *         stored_key = self.DIGEST(client_key.digest())
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_salted_password, __pyx_mstate_global->__pyx_kp_b_Client_Key, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_client_key = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":213
 *         client_key = hmac.new(salted_password, b"Client Key", self.DIGEST)
 *         # this allows us to compute the stored key that is residing on the server
 *         stored_key = self.DIGEST(client_key.digest())             # <<<<<<<<<<<<<<
 *         # as well as compute the server key
 *         self.server_key = hmac.new(salted_password, b"Server Key", self.DIGEST)
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_1 = __pyx_v_client_key;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_DIGEST, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_stored_key = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":215
 *         stored_key = self.DIGEST(client_key.digest())
 *         # as well as compute the server key
 *         self.server_key = hmac.new(salted_password, b"Server Key", self.DIGEST)             # <<<<<<<<<<<<<<
 *         # build the authorization message that will be used in the
 *         # client signature
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_salted_password, __pyx_mstate_global->__pyx_kp_b_Server_Key, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->server_key);
  __Pyx_DECREF(__pyx_v_self->server_key);
  __pyx_v_self->server_key = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/scram.pyx":220
 *         # the "c=" portion is for the channel binding, but this is not
 *         # presently implemented
 *         self.authorization_message = self.client_first_message_bare + b"," + \             # <<<<<<<<<<<<<<
 *             self.server_first_message + b",c=" + \
 *             base64.b64encode(self.client_channel_binding) + \
*/
  __pyx_t_3 = PyNumber_Add(__pyx_v_self->client_first_message_bare, __pyx_mstate_global->__pyx_kp_b__12); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "asyncpg/protocol/scram.pyx":221
 *         # presently implemented
 *         self.authorization_message = self.client_first_message_bare + b"," + \
 *             self.server_first_message + b",c=" + \             # <<<<<<<<<<<<<<
 *             base64.b64encode(self.client_channel_binding) + \
 *             b",r=" +  self.server_nonce
*/
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_self->server_first_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_mstate_global->__pyx_kp_b_c_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":222
 *         self.authorization_message = self.client_first_message_bare + b"," + \
 *             self.server_first_message + b",c=" + \
 *             base64.b64encode(self.client_channel_binding) + \             # <<<<<<<<<<<<<<
 *             b",r=" +  self.server_nonce
 *         # sign!
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_b64encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->client_channel_binding};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }

  /* "asyncpg/protocol/scram.pyx":221
 *         # presently implemented
 *         self.authorization_message = self.client_first_message_bare + b"," + \
 *             self.server_first_message + b",c=" + \             # <<<<<<<<<<<<<<
 *             base64.b64encode(self.client_channel_binding) + \
 *             b",r=" +  self.server_nonce
*/
  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":222
 *         self.authorization_message = self.client_first_message_bare + b"," + \
 *             self.server_first_message + b",c=" + \
 *             base64.b64encode(self.client_channel_binding) + \             # <<<<<<<<<<<<<<
 *             b",r=" +  self.server_nonce
 *         # sign!
*/
  __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b_r_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":223
 *             self.server_first_message + b",c=" + \
 *             base64.b64encode(self.client_channel_binding) + \
 *             b",r=" +  self.server_nonce             # <<<<<<<<<<<<<<
 *         # sign!
 *         client_signature = hmac.new(stored_key.digest(),
*/
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_self->server_nonce); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(3, 223, __pyx_L1_error)

  /* "asyncpg/protocol/scram.pyx":220
 *         # the "c=" portion is for the channel binding, but this is not
 *         # presently implemented
 *         self.authorization_message = self.client_first_message_bare + b"," + \             # <<<<<<<<<<<<<<
 *             self.server_first_message + b",c=" + \
 *             base64.b64encode(self.client_channel_binding) + \
*/
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->authorization_message);
  __Pyx_DECREF(__pyx_v_self->authorization_message);
  __pyx_v_self->authorization_message = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":225
 *             b",r=" +  self.server_nonce
 *         # sign!
 *         client_signature = hmac.new(stored_key.digest(),             # <<<<<<<<<<<<<<
 *             self.authorization_message, self.DIGEST)
 *         # and the proof
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = __pyx_v_stored_key;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }

  /* "asyncpg/protocol/scram.pyx":226
 *         # sign!
 *         client_signature = hmac.new(stored_key.digest(),
 *             self.authorization_message, self.DIGEST)             # <<<<<<<<<<<<<<
 *         # and the proof
 *         return self._bytes_xor(client_key.digest(), client_signature.digest())
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_3, __pyx_v_self->authorization_message, __pyx_t_2};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_client_signature = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":228
 *             self.authorization_message, self.DIGEST)
 *         # and the proof
 *         return self._bytes_xor(client_key.digest(), client_signature.digest())             # <<<<<<<<<<<<<<
 * 
 *     cdef _generate_salted_password(self, str password, bytes salt, int iterations):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_v_client_key;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(3, 228, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_client_signature;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(3, 228, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":198
 *         return base64.b64encode(token)
 * 
 *     cdef _generate_client_proof(self, str password):             # <<<<<<<<<<<<<<
 *         """need to ensure a server response exists, i.e. """
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_client_proof", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_salted_password);
  __Pyx_XDECREF(__pyx_v_client_key);
  __Pyx_XDECREF(__pyx_v_stored_key);
  __Pyx_XDECREF(__pyx_v_client_signature);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pyx":230
 *         return self._bytes_xor(client_key.digest(), client_signature.digest())
 * 
 *     cdef _generate_salted_password(self, str password, bytes salt, int iterations):             # <<<<<<<<<<<<<<
 *         """This follows the "Hi" algorithm specified in RFC5802"""
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_password, PyObject *__pyx_v_salt, int __pyx_v_iterations) {
  PyObject *__pyx_v_p = 0;
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_v_u = 0;
  PyObject *__pyx_v_ui = NULL;
  CYTHON_UNUSED long __pyx_v_x;
  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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  long __pyx_t_7;
  long __pyx_t_8;
  long __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_generate_salted_password", 0);

  /* "asyncpg/protocol/scram.pyx":239
 *         # convert the password to a binary string - UTF8 is safe for SASL
 *         # (though there are SASLPrep rules)
 *         p = password.encode("utf8")             # <<<<<<<<<<<<<<
 *         # the salt needs to be base64 decoded -- full binary must be used
 *         s = base64.b64decode(salt)
*/
  if (unlikely(__pyx_v_password == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
    __PYX_ERR(3, 239, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_p = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":241
 *         p = password.encode("utf8")
 *         # the salt needs to be base64 decoded -- full binary must be used
 *         s = base64.b64decode(salt)             # <<<<<<<<<<<<<<
 *         # the initial signature is the salt with a terminator of a 32-bit string
 *         # ending in 1
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_base64); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_b64decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_salt};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 241, __pyx_L1_error)
  __pyx_v_s = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":244
 *         # the initial signature is the salt with a terminator of a 32-bit string
 *         # ending in 1
 *         ui = hmac.new(p, s + b'\x00\x00\x00\x01', self.DIGEST)             # <<<<<<<<<<<<<<
 *         # grab the initial digest
 *         u = ui.digest()
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_s, __pyx_mstate_global->__pyx_kp_b__13); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_DIGEST); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_p, __pyx_t_2, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_ui = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":246
 *         ui = hmac.new(p, s + b'\x00\x00\x00\x01', self.DIGEST)
 *         # grab the initial digest
 *         u = ui.digest()             # <<<<<<<<<<<<<<
 *         # for X number of iterations, recompute the HMAC signature against the
 *         # password and the latest iteration of the hash, and XOR it with the
*/
  __pyx_t_3 = __pyx_v_ui;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 246, __pyx_L1_error)
  __pyx_v_u = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/scram.pyx":250
 *         # password and the latest iteration of the hash, and XOR it with the
 *         # previous version
 *         for x in range(iterations - 1):             # <<<<<<<<<<<<<<
 *             ui = hmac.new(p, ui.digest(), hashlib.sha256)
 *             # this is a fancy way of XORing two byte strings together
*/
  __pyx_t_7 = (__pyx_v_iterations - 1);
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_x = __pyx_t_9;

    /* "asyncpg/protocol/scram.pyx":251
 *         # previous version
 *         for x in range(iterations - 1):
 *             ui = hmac.new(p, ui.digest(), hashlib.sha256)             # <<<<<<<<<<<<<<
 *             # this is a fancy way of XORing two byte strings together
 *             u = self._bytes_xor(u, ui.digest())
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hmac); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = __pyx_v_ui;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sha256); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_p, __pyx_t_6, __pyx_t_10};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_ui, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/scram.pyx":253
 *             ui = hmac.new(p, ui.digest(), hashlib.sha256)
 *             # this is a fancy way of XORing two byte strings together
 *             u = self._bytes_xor(u, ui.digest())             # <<<<<<<<<<<<<<
 *         return u
 * 
*/
    __pyx_t_2 = __pyx_v_ui;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_digest, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(3, 253, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor(__pyx_v_self, __pyx_v_u, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(3, 253, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_u, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "asyncpg/protocol/scram.pyx":254
 *             # this is a fancy way of XORing two byte strings together
 *             u = self._bytes_xor(u, ui.digest())
 *         return u             # <<<<<<<<<<<<<<
 * 
 *     cdef _normalize_password(self, str original_password):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_u);
  __pyx_r = __pyx_v_u;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":230
 *         return self._bytes_xor(client_key.digest(), client_signature.digest())
 * 
 *     cdef _generate_salted_password(self, str password, bytes salt, int iterations):             # <<<<<<<<<<<<<<
 *         """This follows the "Hi" algorithm specified in RFC5802"""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._generate_salted_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_u);
  __Pyx_XDECREF(__pyx_v_ui);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/scram.pyx":287
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c             # <<<<<<<<<<<<<<
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
 *         )
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 287, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 287, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

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

  /* "asyncpg/protocol/scram.pyx":288
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 288, __pyx_L1_error) }
  __pyx_t_1 = PySequence_Tuple(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 288, __pyx_L1_error)
      #endif
      if (__pyx_t_3 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
    #endif
    ++__pyx_t_3;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_b1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 288, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = (!__pyx_t_8);
    if (__pyx_t_9) {

      /* "asyncpg/protocol/scram.pyx":287
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c             # <<<<<<<<<<<<<<
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
 *         )
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_c12); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(3, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_9) {
        __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__14);
        __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__14;
      } else {
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_c);
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_c;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(3, 287, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/scram.pyx":288
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)             # <<<<<<<<<<<<<<
 *         )
 * 
*/
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/scram.pyx":287
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c             # <<<<<<<<<<<<<<
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
 *         )
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 313, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

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

  /* "asyncpg/protocol/scram.pyx":314
 *             if any(
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 314, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 314, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 314, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 314, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 314, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(3, 314, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_in_prohibited_table);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_in_prohibited_table, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_in_prohibited_table);
    __pyx_t_6 = __pyx_cur_scope->__pyx_v_in_prohibited_table; 
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_c)) { __Pyx_RaiseClosureNameError("c"); __PYX_ERR(3, 313, __pyx_L1_error) }
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_c};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_8) {

      /* "asyncpg/protocol/scram.pyx":312
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:
 *             if any(             # <<<<<<<<<<<<<<
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
*/
      __Pyx_XDECREF(__pyx_r);

      /* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }

    /* "asyncpg/protocol/scram.pyx":314
 *             if any(
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {

    /* "asyncpg/protocol/scram.pyx":312
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:
 *             if any(             # <<<<<<<<<<<<<<
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
*/
    __Pyx_XDECREF(__pyx_r);

    /* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/scram.pyx":327
 *         #    character must be the first and last character of the string
 *         # RandALCat characters are found in table D.1, whereas LCat are in D.2
 *         if any(stringprep.in_table_d1(c) for c in normalized_password_tuple):             # <<<<<<<<<<<<<<
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 327, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 327, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 327, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 327, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
    #endif
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 327, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/scram.pyx":336
 *             # if any characters are in D.2, use the original password
 *             if any(
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 336, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication__normalize_p, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 336, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(3, 336, __pyx_L1_error) }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 336, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
    #endif
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_in_table_d2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_c};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "asyncpg/protocol/scram.pyx":335
 * 
 *             # if any characters are in D.2, use the original password
 *             if any(             # <<<<<<<<<<<<<<
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple
 *             ):
*/
      __Pyx_XDECREF(__pyx_r);

      /* "asyncpg/protocol/scram.pyx":336
 *             # if any characters are in D.2, use the original password
 *             if any(
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*else*/ {

    /* "asyncpg/protocol/scram.pyx":335
 * 
 *             # if any characters are in D.2, use the original password
 *             if any(             # <<<<<<<<<<<<<<
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple
 *             ):
*/
    __Pyx_XDECREF(__pyx_r);

    /* "asyncpg/protocol/scram.pyx":336
 *             # if any characters are in D.2, use the original password
 *             if any(
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "asyncpg/protocol/scram.pyx":256
 *         return u
 * 
 *     cdef _normalize_password(self, str original_password):             # <<<<<<<<<<<<<<
 *         """Normalize the password using the SASLprep from RFC4013"""
 *         cdef:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self, PyObject *__pyx_v_original_password) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *__pyx_cur_scope;
  PyObject *__pyx_v_normalized_password = 0;
  PyObject *__pyx_v_normalized_password_tuple = NULL;
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13 = 0;
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14 = 0;
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15 = 0;
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_normalize_password", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 256, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }

  /* "asyncpg/protocol/scram.pyx":271
 *         # https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/common/saslprep.c
 *         # using the `pg_saslprep` function
 *         normalized_password = original_password             # <<<<<<<<<<<<<<
 *         # if the original password is an ASCII string or fails to encode as a
 *         # UTF-8 string, then no further action is needed
*/
  __Pyx_INCREF(__pyx_v_original_password);
  __pyx_v_normalized_password = __pyx_v_original_password;

  /* "asyncpg/protocol/scram.pyx":274
 *         # if the original password is an ASCII string or fails to encode as a
 *         # UTF-8 string, then no further action is needed
 *         try:             # <<<<<<<<<<<<<<
 *             original_password.encode("ascii")
 *         except UnicodeEncodeError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/scram.pyx":275
 *         # UTF-8 string, then no further action is needed
 *         try:
 *             original_password.encode("ascii")             # <<<<<<<<<<<<<<
 *         except UnicodeEncodeError:
 *             pass
*/
      if (unlikely(__pyx_v_original_password == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
        __PYX_ERR(3, 275, __pyx_L3_error)
      }
      __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_v_original_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 275, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/scram.pyx":274
 *         # if the original password is an ASCII string or fails to encode as a
 *         # UTF-8 string, then no further action is needed
 *         try:             # <<<<<<<<<<<<<<
 *             original_password.encode("ascii")
 *         except UnicodeEncodeError:
*/
    }

    /* "asyncpg/protocol/scram.pyx":279
 *             pass
 *         else:
 *             return original_password             # <<<<<<<<<<<<<<
 * 
 *         # Step 1 of SASLPrep: Map. Per the algorithm, we map non-ascii space
*/
    /*else:*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_original_password);
      __pyx_r = __pyx_v_original_password;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/scram.pyx":276
 *         try:
 *             original_password.encode("ascii")
 *         except UnicodeEncodeError:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_UnicodeEncodeError))));
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/scram.pyx":274
 *         # if the original password is an ASCII string or fails to encode as a
 *         # UTF-8 string, then no further action is needed
 *         try:             # <<<<<<<<<<<<<<
 *             original_password.encode("ascii")
 *         except UnicodeEncodeError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "asyncpg/protocol/scram.pyx":287
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(
 *             ' ' if stringprep.in_table_c12(c) else c             # <<<<<<<<<<<<<<
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
 *         )
*/
  __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_genexpr(NULL, __pyx_v_normalized_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "asyncpg/protocol/scram.pyx":286
 *         # Table C.1.2 -- non-ASCII spaces
 *         # Table B.1 -- "Commonly mapped to nothing"
 *         normalized_password = u"".join(             # <<<<<<<<<<<<<<
 *             ' ' if stringprep.in_table_c12(c) else c
 *             for c in tuple(normalized_password) if not stringprep.in_table_b1(c)
*/
  __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__15, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_normalized_password, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":293
 *         # If at this point the password is empty, PostgreSQL uses the original
 *         # password
 *         if not normalized_password:             # <<<<<<<<<<<<<<
 *             return original_password
 * 
*/
  if (__pyx_v_normalized_password == Py_None) __pyx_t_7 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 293, __pyx_L1_error)
    __pyx_t_7 = (__pyx_temp != 0);
  }

  __pyx_t_8 = (!__pyx_t_7);
  if (__pyx_t_8) {

    /* "asyncpg/protocol/scram.pyx":294
 *         # password
 *         if not normalized_password:
 *             return original_password             # <<<<<<<<<<<<<<
 * 
 *         # Step 2 of SASLPrep: Normalize. Normalize the password using the
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_original_password);
    __pyx_r = __pyx_v_original_password;
    goto __pyx_L0;

    /* "asyncpg/protocol/scram.pyx":293
 *         # If at this point the password is empty, PostgreSQL uses the original
 *         # password
 *         if not normalized_password:             # <<<<<<<<<<<<<<
 *             return original_password
 * 
*/
  }

  /* "asyncpg/protocol/scram.pyx":298
 *         # Step 2 of SASLPrep: Normalize. Normalize the password using the
 *         # Unicode normalization algorithm to NFKC form
 *         normalized_password = unicodedata.normalize('NFKC', normalized_password)             # <<<<<<<<<<<<<<
 * 
 *         # If the password is not empty, PostgreSQL uses the original password
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_unicodedata); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_normalize); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_NFKC, __pyx_v_normalized_password};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(3, 298, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_normalized_password, ((PyObject*)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":301
 * 
 *         # If the password is not empty, PostgreSQL uses the original password
 *         if not normalized_password:             # <<<<<<<<<<<<<<
 *             return original_password
 * 
*/
  if (__pyx_v_normalized_password == Py_None) __pyx_t_8 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_normalized_password);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(3, 301, __pyx_L1_error)
    __pyx_t_8 = (__pyx_temp != 0);
  }

  __pyx_t_7 = (!__pyx_t_8);
  if (__pyx_t_7) {

    /* "asyncpg/protocol/scram.pyx":302
 *         # If the password is not empty, PostgreSQL uses the original password
 *         if not normalized_password:
 *             return original_password             # <<<<<<<<<<<<<<
 * 
 *         normalized_password_tuple = tuple(normalized_password)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_original_password);
    __pyx_r = __pyx_v_original_password;
    goto __pyx_L0;

    /* "asyncpg/protocol/scram.pyx":301
 * 
 *         # If the password is not empty, PostgreSQL uses the original password
 *         if not normalized_password:             # <<<<<<<<<<<<<<
 *             return original_password
 * 
*/
  }

  /* "asyncpg/protocol/scram.pyx":304
 *             return original_password
 * 
 *         normalized_password_tuple = tuple(normalized_password)             # <<<<<<<<<<<<<<
 * 
 *         # Step 3 of SASLPrep: Prohobited characters. If PostgreSQL detects any
*/
  __pyx_t_4 = PySequence_Tuple(__pyx_v_normalized_password); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_normalized_password_tuple = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":311
 *         # We also include "unassigned code points" in the prohibited character
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:             # <<<<<<<<<<<<<<
 *             if any(
 *                 in_prohibited_table(c)
*/
  __pyx_t_4 = __pyx_v_normalized_password_tuple; __Pyx_INCREF(__pyx_t_4);
  __pyx_t_12 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 311, __pyx_L1_error)
      #endif
      if (__pyx_t_12 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12));
    #else
    __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12);
    #endif
    ++__pyx_t_12;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;

    /* "asyncpg/protocol/scram.pyx":314
 *             if any(
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_SASLPREP_PROHIBITED); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "asyncpg/protocol/scram.pyx":313
 *         for c in normalized_password_tuple:
 *             if any(
 *                 in_prohibited_table(c)             # <<<<<<<<<<<<<<
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
*/
    __pyx_t_6 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "asyncpg/protocol/scram.pyx":312
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:
 *             if any(             # <<<<<<<<<<<<<<
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
*/
    if (__pyx_t_7) {

      /* "asyncpg/protocol/scram.pyx":316
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
 *             ):
 *                 return original_password             # <<<<<<<<<<<<<<
 * 
 *         # Step 4 of SASLPrep: Bi-directional characters. PostgreSQL follows the
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_original_password);
      __pyx_r = __pyx_v_original_password;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;

      /* "asyncpg/protocol/scram.pyx":312
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:
 *             if any(             # <<<<<<<<<<<<<<
 *                 in_prohibited_table(c)
 *                 for in_prohibited_table in self.SASLPREP_PROHIBITED
*/
    }

    /* "asyncpg/protocol/scram.pyx":311
 *         # We also include "unassigned code points" in the prohibited character
 *         # category as PostgreSQL does the same
 *         for c in normalized_password_tuple:             # <<<<<<<<<<<<<<
 *             if any(
 *                 in_prohibited_table(c)
*/
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":327
 *         #    character must be the first and last character of the string
 *         # RandALCat characters are found in table D.1, whereas LCat are in D.2
 *         if any(stringprep.in_table_d1(c) for c in normalized_password_tuple):             # <<<<<<<<<<<<<<
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
*/
  __pyx_t_4 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_6genexpr(NULL, __pyx_v_normalized_password_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(3, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__pyx_t_7) {

    /* "asyncpg/protocol/scram.pyx":330
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
 *             if not (stringprep.in_table_d1(normalized_password_tuple[0]) and             # <<<<<<<<<<<<<<
 *                     stringprep.in_table_d1(normalized_password_tuple[-1])):
 *                 return original_password
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_normalized_password_tuple, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 330, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L19_bool_binop_done;
    }

    /* "asyncpg/protocol/scram.pyx":331
 *             # return the original password
 *             if not (stringprep.in_table_d1(normalized_password_tuple[0]) and
 *                     stringprep.in_table_d1(normalized_password_tuple[-1])):             # <<<<<<<<<<<<<<
 *                 return original_password
 * 
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_in_table_d1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_normalized_password_tuple, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6};
      __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
    }
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 331, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_7 = __pyx_t_8;
    __pyx_L19_bool_binop_done:;

    /* "asyncpg/protocol/scram.pyx":330
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
 *             if not (stringprep.in_table_d1(normalized_password_tuple[0]) and             # <<<<<<<<<<<<<<
 *                     stringprep.in_table_d1(normalized_password_tuple[-1])):
 *                 return original_password
*/
    __pyx_t_8 = (!__pyx_t_7);
    if (__pyx_t_8) {

      /* "asyncpg/protocol/scram.pyx":332
 *             if not (stringprep.in_table_d1(normalized_password_tuple[0]) and
 *                     stringprep.in_table_d1(normalized_password_tuple[-1])):
 *                 return original_password             # <<<<<<<<<<<<<<
 * 
 *             # if any characters are in D.2, use the original password
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_original_password);
      __pyx_r = __pyx_v_original_password;
      goto __pyx_L0;

      /* "asyncpg/protocol/scram.pyx":330
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
 *             if not (stringprep.in_table_d1(normalized_password_tuple[0]) and             # <<<<<<<<<<<<<<
 *                     stringprep.in_table_d1(normalized_password_tuple[-1])):
 *                 return original_password
*/
    }

    /* "asyncpg/protocol/scram.pyx":336
 *             # if any characters are in D.2, use the original password
 *             if any(
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple             # <<<<<<<<<<<<<<
 *             ):
 *                 return original_password
*/
    __pyx_t_10 = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_9genexpr(NULL, __pyx_v_normalized_password_tuple); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/scram.pyx":335
 * 
 *             # if any characters are in D.2, use the original password
 *             if any(             # <<<<<<<<<<<<<<
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple
 *             ):
*/
    if (__pyx_t_8) {

      /* "asyncpg/protocol/scram.pyx":338
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple
 *             ):
 *                 return original_password             # <<<<<<<<<<<<<<
 * 
 *         # return the normalized password
*/
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_original_password);
      __pyx_r = __pyx_v_original_password;
      goto __pyx_L0;

      /* "asyncpg/protocol/scram.pyx":335
 * 
 *             # if any characters are in D.2, use the original password
 *             if any(             # <<<<<<<<<<<<<<
 *                 stringprep.in_table_d2(c) for c in normalized_password_tuple
 *             ):
*/
    }

    /* "asyncpg/protocol/scram.pyx":327
 *         #    character must be the first and last character of the string
 *         # RandALCat characters are found in table D.1, whereas LCat are in D.2
 *         if any(stringprep.in_table_d1(c) for c in normalized_password_tuple):             # <<<<<<<<<<<<<<
 *             # if the first character or the last character are not in D.1,
 *             # return the original password
*/
  }

  /* "asyncpg/protocol/scram.pyx":341
 * 
 *         # return the normalized password
 *         return normalized_password             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_normalized_password);
  __pyx_r = __pyx_v_normalized_password;
  goto __pyx_L0;

  /* "asyncpg/protocol/scram.pyx":256
 *         return u
 * 
 *     cdef _normalize_password(self, str original_password):             # <<<<<<<<<<<<<<
 *         """Normalize the password using the SASLprep from RFC4013"""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication._normalize_password", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_normalized_password);
  __Pyx_XDECREF(__pyx_v_normalized_password_tuple);
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_2generator13);
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_5generator14);
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_8generator15);
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19_normalize_password_11generator16);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pxd":10
 * cdef class SCRAMAuthentication:
 *     cdef:
 *         readonly bytes authentication_method             # <<<<<<<<<<<<<<
 *         readonly bytes authorization_message
 *         readonly bytes client_channel_binding
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->authentication_method);
  __pyx_r = __pyx_v_self->authentication_method;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":11
 *     cdef:
 *         readonly bytes authentication_method
 *         readonly bytes authorization_message             # <<<<<<<<<<<<<<
 *         readonly bytes client_channel_binding
 *         readonly bytes client_first_message_bare
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->authorization_message);
  __pyx_r = __pyx_v_self->authorization_message;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":12
 *         readonly bytes authentication_method
 *         readonly bytes authorization_message
 *         readonly bytes client_channel_binding             # <<<<<<<<<<<<<<
 *         readonly bytes client_first_message_bare
 *         readonly bytes client_nonce
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->client_channel_binding);
  __pyx_r = __pyx_v_self->client_channel_binding;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":13
 *         readonly bytes authorization_message
 *         readonly bytes client_channel_binding
 *         readonly bytes client_first_message_bare             # <<<<<<<<<<<<<<
 *         readonly bytes client_nonce
 *         readonly bytes client_proof
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->client_first_message_bare);
  __pyx_r = __pyx_v_self->client_first_message_bare;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":14
 *         readonly bytes client_channel_binding
 *         readonly bytes client_first_message_bare
 *         readonly bytes client_nonce             # <<<<<<<<<<<<<<
 *         readonly bytes client_proof
 *         readonly bytes password_salt
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->client_nonce);
  __pyx_r = __pyx_v_self->client_nonce;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":15
 *         readonly bytes client_first_message_bare
 *         readonly bytes client_nonce
 *         readonly bytes client_proof             # <<<<<<<<<<<<<<
 *         readonly bytes password_salt
 *         readonly int   password_iterations
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->client_proof);
  __pyx_r = __pyx_v_self->client_proof;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":16
 *         readonly bytes client_nonce
 *         readonly bytes client_proof
 *         readonly bytes password_salt             # <<<<<<<<<<<<<<
 *         readonly int   password_iterations
 *         readonly bytes server_first_message
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->password_salt);
  __pyx_r = __pyx_v_self->password_salt;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":17
 *         readonly bytes client_proof
 *         readonly bytes password_salt
 *         readonly int   password_iterations             # <<<<<<<<<<<<<<
 *         readonly bytes server_first_message
 *         # server_key is an instance of hmac.HAMC
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->password_iterations); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.password_iterations.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/scram.pxd":18
 *         readonly bytes password_salt
 *         readonly int   password_iterations
 *         readonly bytes server_first_message             # <<<<<<<<<<<<<<
 *         # server_key is an instance of hmac.HAMC
 *         readonly object server_key
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->server_first_message);
  __pyx_r = __pyx_v_self->server_first_message;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":20
 *         readonly bytes server_first_message
 *         # server_key is an instance of hmac.HAMC
 *         readonly object server_key             # <<<<<<<<<<<<<<
 *         readonly bytes server_nonce
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->server_key);
  __pyx_r = __pyx_v_self->server_key;
  goto __pyx_L0;

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

/* "asyncpg/protocol/scram.pxd":21
 *         # server_key is an instance of hmac.HAMC
 *         readonly object server_key
 *         readonly bytes server_nonce             # <<<<<<<<<<<<<<
 * 
 *     cdef create_client_first_message(self, str username)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->server_nonce);
  __pyx_r = __pyx_v_self->server_nonce;
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_2__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_4__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.SCRAMAuthentication.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":26
 * cdef class CoreProtocol:
 * 
 *     def __init__(self, addr, con_params):             # <<<<<<<<<<<<<<
 *         self.address = addr
 *         # type of `con_params` is `_ConnectionParameters`
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_addr = 0;
  PyObject *__pyx_v_con_params = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addr,&__pyx_mstate_global->__pyx_n_u_con_params,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(15, 26, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 26, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 26, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(15, 26, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(15, 26, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(15, 26, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(15, 26, __pyx_L3_error)
    }
    __pyx_v_addr = values[0];
    __pyx_v_con_params = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(15, 26, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v_addr, __pyx_v_con_params);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_con_params) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "asyncpg/protocol/coreproto.pyx":27
 * 
 *     def __init__(self, addr, con_params):
 *         self.address = addr             # <<<<<<<<<<<<<<
 *         # type of `con_params` is `_ConnectionParameters`
 *         self.buffer = ReadBuffer()
*/
  __Pyx_INCREF(__pyx_v_addr);
  __Pyx_GIVEREF(__pyx_v_addr);
  __Pyx_GOTREF(__pyx_v_self->address);
  __Pyx_DECREF(__pyx_v_self->address);
  __pyx_v_self->address = __pyx_v_addr;

  /* "asyncpg/protocol/coreproto.pyx":29
 *         self.address = addr
 *         # type of `con_params` is `_ConnectionParameters`
 *         self.buffer = ReadBuffer()             # <<<<<<<<<<<<<<
 *         self.user = con_params.user
 *         self.password = con_params.password
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 29, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->buffer);
  __Pyx_DECREF((PyObject *)__pyx_v_self->buffer);
  __pyx_v_self->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":30
 *         # type of `con_params` is `_ConnectionParameters`
 *         self.buffer = ReadBuffer()
 *         self.user = con_params.user             # <<<<<<<<<<<<<<
 *         self.password = con_params.password
 *         self.auth_msg = None
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user, __pyx_t_1) < (0)) __PYX_ERR(15, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":31
 *         self.buffer = ReadBuffer()
 *         self.user = con_params.user
 *         self.password = con_params.password             # <<<<<<<<<<<<<<
 *         self.auth_msg = None
 *         self.con_params = con_params
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password, __pyx_t_1) < (0)) __PYX_ERR(15, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":32
 *         self.user = con_params.user
 *         self.password = con_params.password
 *         self.auth_msg = None             # <<<<<<<<<<<<<<
 *         self.con_params = con_params
 *         self.con_status = CONNECTION_BAD
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, Py_None) < (0)) __PYX_ERR(15, 32, __pyx_L1_error)

  /* "asyncpg/protocol/coreproto.pyx":33
 *         self.password = con_params.password
 *         self.auth_msg = None
 *         self.con_params = con_params             # <<<<<<<<<<<<<<
 *         self.con_status = CONNECTION_BAD
 *         self.state = PROTOCOL_IDLE
*/
  __Pyx_INCREF(__pyx_v_con_params);
  __Pyx_GIVEREF(__pyx_v_con_params);
  __Pyx_GOTREF(__pyx_v_self->con_params);
  __Pyx_DECREF(__pyx_v_self->con_params);
  __pyx_v_self->con_params = __pyx_v_con_params;

  /* "asyncpg/protocol/coreproto.pyx":34
 *         self.auth_msg = None
 *         self.con_params = con_params
 *         self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *         self.state = PROTOCOL_IDLE
 *         self.xact_status = PQTRANS_IDLE
*/
  __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

  /* "asyncpg/protocol/coreproto.pyx":35
 *         self.con_params = con_params
 *         self.con_status = CONNECTION_BAD
 *         self.state = PROTOCOL_IDLE             # <<<<<<<<<<<<<<
 *         self.xact_status = PQTRANS_IDLE
 *         self.encoding = 'utf-8'
*/
  __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE;

  /* "asyncpg/protocol/coreproto.pyx":36
 *         self.con_status = CONNECTION_BAD
 *         self.state = PROTOCOL_IDLE
 *         self.xact_status = PQTRANS_IDLE             # <<<<<<<<<<<<<<
 *         self.encoding = 'utf-8'
 *         # type of `scram` is `SCRAMAuthentcation`
*/
  __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE;

  /* "asyncpg/protocol/coreproto.pyx":37
 *         self.state = PROTOCOL_IDLE
 *         self.xact_status = PQTRANS_IDLE
 *         self.encoding = 'utf-8'             # <<<<<<<<<<<<<<
 *         # type of `scram` is `SCRAMAuthentcation`
 *         self.scram = None
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_utf_8);
  __Pyx_GOTREF(__pyx_v_self->encoding);
  __Pyx_DECREF(__pyx_v_self->encoding);
  __pyx_v_self->encoding = __pyx_mstate_global->__pyx_kp_u_utf_8;

  /* "asyncpg/protocol/coreproto.pyx":39
 *         self.encoding = 'utf-8'
 *         # type of `scram` is `SCRAMAuthentcation`
 *         self.scram = None             # <<<<<<<<<<<<<<
 *         # type of `gss_ctx` is `gssapi.SecurityContext` or
 *         # `sspilib.SecurityContext`
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->scram);
  __Pyx_DECREF((PyObject *)__pyx_v_self->scram);
  __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":42
 *         # type of `gss_ctx` is `gssapi.SecurityContext` or
 *         # `sspilib.SecurityContext`
 *         self.gss_ctx = None             # <<<<<<<<<<<<<<
 * 
 *         self._reset_result()
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->gss_ctx);
  __Pyx_DECREF(__pyx_v_self->gss_ctx);
  __pyx_v_self->gss_ctx = Py_None;

  /* "asyncpg/protocol/coreproto.pyx":44
 *         self.gss_ctx = None
 * 
 *         self._reset_result()             # <<<<<<<<<<<<<<
 * 
 *     cpdef is_in_transaction(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":26
 * cdef class CoreProtocol:
 * 
 *     def __init__(self, addr, con_params):             # <<<<<<<<<<<<<<
 *         self.address = addr
 *         # type of `con_params` is `_ConnectionParameters`
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":46
 *         self._reset_result()
 * 
 *     cpdef is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         # PQTRANS_INTRANS = idle, within transaction block
 *         # PQTRANS_INERROR = idle, within failed transaction
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_in_transaction", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_is_in_transaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 46, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "asyncpg/protocol/coreproto.pyx":49
 *         # PQTRANS_INTRANS = idle, within transaction block
 *         # PQTRANS_INERROR = idle, within failed transaction
 *         return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR)             # <<<<<<<<<<<<<<
 * 
 *     cdef _read_server_messages(self):
*/
  __Pyx_XDECREF(__pyx_r);
  switch (__pyx_v_self->xact_status) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS:
    case __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR:
    __pyx_t_6 = 1;
    break;
    default:
    __pyx_t_6 = 0;
    break;
  }
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":46
 *         self._reset_result()
 * 
 *     cpdef is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         # PQTRANS_INTRANS = idle, within transaction block
 *         # PQTRANS_INERROR = idle, within failed transaction
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.is_in_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction = {"is_in_transaction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_in_transaction (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_in_transaction", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_in_transaction", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_2is_in_transaction(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_in_transaction", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.is_in_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":51
 *         return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR)
 * 
 *     cdef _read_server_messages(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char mtype
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  char __pyx_v_mtype;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_state;
  __pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method __pyx_v_take_message;
  __pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method __pyx_v_get_message_type;
  PyObject *__pyx_v_ex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  int __pyx_t_3;
  char __pyx_t_4;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14[5];
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  char const *__pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_server_messages", 0);

  /* "asyncpg/protocol/coreproto.pyx":56
 *             ProtocolState state
 *             pgproto.take_message_method take_message = \
 *                 <pgproto.take_message_method>self.buffer.take_message             # <<<<<<<<<<<<<<
 *             pgproto.get_message_type_method get_message_type= \
 *                 <pgproto.get_message_type_method>self.buffer.get_message_type
*/
  __pyx_v_take_message = ((__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->take_message);

  /* "asyncpg/protocol/coreproto.pyx":58
 *                 <pgproto.take_message_method>self.buffer.take_message
 *             pgproto.get_message_type_method get_message_type= \
 *                 <pgproto.get_message_type_method>self.buffer.get_message_type             # <<<<<<<<<<<<<<
 * 
 *         while take_message(self.buffer) == 1:
*/
  __pyx_v_get_message_type = ((__pyx_t_7asyncpg_7pgproto_7pgproto_get_message_type_method)__pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type);

  /* "asyncpg/protocol/coreproto.pyx":60
 *                 <pgproto.get_message_type_method>self.buffer.get_message_type
 * 
 *         while take_message(self.buffer) == 1:             # <<<<<<<<<<<<<<
 *             mtype = get_message_type(self.buffer)
 *             state = self.state
*/
  while (1) {
    __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_take_message(__pyx_t_1); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(15, 60, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (__pyx_t_2 == 1);
    if (!__pyx_t_3) break;

    /* "asyncpg/protocol/coreproto.pyx":61
 * 
 *         while take_message(self.buffer) == 1:
 *             mtype = get_message_type(self.buffer)             # <<<<<<<<<<<<<<
 *             state = self.state
 * 
*/
    __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_v_get_message_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_mtype = __pyx_t_4;

    /* "asyncpg/protocol/coreproto.pyx":62
 *         while take_message(self.buffer) == 1:
 *             mtype = get_message_type(self.buffer)
 *             state = self.state             # <<<<<<<<<<<<<<
 * 
 *             try:
*/
    __pyx_t_5 = __pyx_v_self->state;
    __pyx_v_state = __pyx_t_5;

    /* "asyncpg/protocol/coreproto.pyx":64
 *             state = self.state
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == b'S':
 *                     # ParameterStatus
*/
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "asyncpg/protocol/coreproto.pyx":65
 * 
 *             try:
 *                 if mtype == b'S':             # <<<<<<<<<<<<<<
 *                     # ParameterStatus
 *                     self._parse_msg_parameter_status()
*/
          __pyx_t_3 = (__pyx_v_mtype == 'S');
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":67
 *                 if mtype == b'S':
 *                     # ParameterStatus
 *                     self._parse_msg_parameter_status()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == b'A':
*/
            __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_parameter_status(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 67, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "asyncpg/protocol/coreproto.pyx":65
 * 
 *             try:
 *                 if mtype == b'S':             # <<<<<<<<<<<<<<
 *                     # ParameterStatus
 *                     self._parse_msg_parameter_status()
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":69
 *                     self._parse_msg_parameter_status()
 * 
 *                 elif mtype == b'A':             # <<<<<<<<<<<<<<
 *                     # NotificationResponse
 *                     self._parse_msg_notification()
*/
          __pyx_t_3 = (__pyx_v_mtype == 'A');
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":71
 *                 elif mtype == b'A':
 *                     # NotificationResponse
 *                     self._parse_msg_notification()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == b'N':
*/
            __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_notification(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 71, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "asyncpg/protocol/coreproto.pyx":69
 *                     self._parse_msg_parameter_status()
 * 
 *                 elif mtype == b'A':             # <<<<<<<<<<<<<<
 *                     # NotificationResponse
 *                     self._parse_msg_notification()
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":73
 *                     self._parse_msg_notification()
 * 
 *                 elif mtype == b'N':             # <<<<<<<<<<<<<<
 *                     # 'N' - NoticeResponse
 *                     self._on_notice(self._parse_msg_error_response(False))
*/
          __pyx_t_3 = (__pyx_v_mtype == 'N');
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":75
 *                 elif mtype == b'N':
 *                     # 'N' - NoticeResponse
 *                     self._on_notice(self._parse_msg_error_response(False))             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_AUTH:
*/
            __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 75, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notice(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 75, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":73
 *                     self._parse_msg_notification()
 * 
 *                 elif mtype == b'N':             # <<<<<<<<<<<<<<
 *                     # 'N' - NoticeResponse
 *                     self._on_notice(self._parse_msg_error_response(False))
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":77
 *                     self._on_notice(self._parse_msg_error_response(False))
 * 
 *                 elif state == PROTOCOL_AUTH:             # <<<<<<<<<<<<<<
 *                     self._process__auth(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":78
 * 
 *                 elif state == PROTOCOL_AUTH:
 *                     self._process__auth(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_PREPARE:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__auth(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 78, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":77
 *                     self._on_notice(self._parse_msg_error_response(False))
 * 
 *                 elif state == PROTOCOL_AUTH:             # <<<<<<<<<<<<<<
 *                     self._process__auth(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":80
 *                     self._process__auth(mtype)
 * 
 *                 elif state == PROTOCOL_PREPARE:             # <<<<<<<<<<<<<<
 *                     self._process__prepare(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":81
 * 
 *                 elif state == PROTOCOL_PREPARE:
 *                     self._process__prepare(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__prepare(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 81, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":80
 *                     self._process__auth(mtype)
 * 
 *                 elif state == PROTOCOL_PREPARE:             # <<<<<<<<<<<<<<
 *                     self._process__prepare(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":83
 *                     self._process__prepare(mtype)
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":84
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE:
 *                     self._process__bind_execute(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE_MANY:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 84, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":83
 *                     self._process__prepare(mtype)
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":86
 *                     self._process__bind_execute(mtype)
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE_MANY:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute_many(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":87
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE_MANY:
 *                     self._process__bind_execute_many(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_EXECUTE:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute_many(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 87, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":86
 *                     self._process__bind_execute(mtype)
 * 
 *                 elif state == PROTOCOL_BIND_EXECUTE_MANY:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute_many(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":89
 *                     self._process__bind_execute_many(mtype)
 * 
 *                 elif state == PROTOCOL_EXECUTE:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":90
 * 
 *                 elif state == PROTOCOL_EXECUTE:
 *                     self._process__bind_execute(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_BIND:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind_execute(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 90, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":89
 *                     self._process__bind_execute_many(mtype)
 * 
 *                 elif state == PROTOCOL_EXECUTE:             # <<<<<<<<<<<<<<
 *                     self._process__bind_execute(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":92
 *                     self._process__bind_execute(mtype)
 * 
 *                 elif state == PROTOCOL_BIND:             # <<<<<<<<<<<<<<
 *                     self._process__bind(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":93
 * 
 *                 elif state == PROTOCOL_BIND:
 *                     self._process__bind(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_CLOSE_STMT_PORTAL:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__bind(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 93, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":92
 *                     self._process__bind_execute(mtype)
 * 
 *                 elif state == PROTOCOL_BIND:             # <<<<<<<<<<<<<<
 *                     self._process__bind(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":95
 *                     self._process__bind(mtype)
 * 
 *                 elif state == PROTOCOL_CLOSE_STMT_PORTAL:             # <<<<<<<<<<<<<<
 *                     self._process__close_stmt_portal(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":96
 * 
 *                 elif state == PROTOCOL_CLOSE_STMT_PORTAL:
 *                     self._process__close_stmt_portal(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_SIMPLE_QUERY:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__close_stmt_portal(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 96, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":95
 *                     self._process__bind(mtype)
 * 
 *                 elif state == PROTOCOL_CLOSE_STMT_PORTAL:             # <<<<<<<<<<<<<<
 *                     self._process__close_stmt_portal(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":98
 *                     self._process__close_stmt_portal(mtype)
 * 
 *                 elif state == PROTOCOL_SIMPLE_QUERY:             # <<<<<<<<<<<<<<
 *                     self._process__simple_query(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":99
 * 
 *                 elif state == PROTOCOL_SIMPLE_QUERY:
 *                     self._process__simple_query(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_COPY_OUT:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__simple_query(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 99, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":98
 *                     self._process__close_stmt_portal(mtype)
 * 
 *                 elif state == PROTOCOL_SIMPLE_QUERY:             # <<<<<<<<<<<<<<
 *                     self._process__simple_query(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":101
 *                     self._process__simple_query(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_OUT:             # <<<<<<<<<<<<<<
 *                     self._process__copy_out(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":102
 * 
 *                 elif state == PROTOCOL_COPY_OUT:
 *                     self._process__copy_out(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_out(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 102, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":101
 *                     self._process__simple_query(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_OUT:             # <<<<<<<<<<<<<<
 *                     self._process__copy_out(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":104
 *                     self._process__copy_out(mtype)
 * 
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or             # <<<<<<<<<<<<<<
 *                         state == PROTOCOL_COPY_OUT_DONE):
 *                     self._process__copy_out_data(mtype)
*/
          switch (__pyx_v_state) {
            case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA:
            case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE:

            /* "asyncpg/protocol/coreproto.pyx":105
 * 
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or
 *                         state == PROTOCOL_COPY_OUT_DONE):             # <<<<<<<<<<<<<<
 *                     self._process__copy_out_data(mtype)
 * 
*/
            __pyx_t_3 = 1;

            /* "asyncpg/protocol/coreproto.pyx":104
 *                     self._process__copy_out(mtype)
 * 
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or             # <<<<<<<<<<<<<<
 *                         state == PROTOCOL_COPY_OUT_DONE):
 *                     self._process__copy_out_data(mtype)
*/
            break;
            default:
            __pyx_t_3 = 0;
            break;
          }
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":106
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or
 *                         state == PROTOCOL_COPY_OUT_DONE):
 *                     self._process__copy_out_data(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_COPY_IN:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_out_data(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 106, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":104
 *                     self._process__copy_out(mtype)
 * 
 *                 elif (state == PROTOCOL_COPY_OUT_DATA or             # <<<<<<<<<<<<<<
 *                         state == PROTOCOL_COPY_OUT_DONE):
 *                     self._process__copy_out_data(mtype)
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":108
 *                     self._process__copy_out_data(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_IN:             # <<<<<<<<<<<<<<
 *                     self._process__copy_in(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":109
 * 
 *                 elif state == PROTOCOL_COPY_IN:
 *                     self._process__copy_in(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_COPY_IN_DATA:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_in(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 109, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":108
 *                     self._process__copy_out_data(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_IN:             # <<<<<<<<<<<<<<
 *                     self._process__copy_in(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":111
 *                     self._process__copy_in(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_IN_DATA:             # <<<<<<<<<<<<<<
 *                     self._process__copy_in_data(mtype)
 * 
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":112
 * 
 *                 elif state == PROTOCOL_COPY_IN_DATA:
 *                     self._process__copy_in_data(mtype)             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_CANCELLED:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_process__copy_in_data(__pyx_v_self, __pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 112, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":111
 *                     self._process__copy_in(mtype)
 * 
 *                 elif state == PROTOCOL_COPY_IN_DATA:             # <<<<<<<<<<<<<<
 *                     self._process__copy_in_data(mtype)
 * 
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":114
 *                     self._process__copy_in_data(mtype)
 * 
 *                 elif state == PROTOCOL_CANCELLED:             # <<<<<<<<<<<<<<
 *                     # discard all messages until the sync message
 *                     if mtype == b'E':
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":116
 *                 elif state == PROTOCOL_CANCELLED:
 *                     # discard all messages until the sync message
 *                     if mtype == b'E':             # <<<<<<<<<<<<<<
 *                         self._parse_msg_error_response(True)
 *                     elif mtype == b'Z':
*/
            switch (__pyx_v_mtype) {
              case 'E':

              /* "asyncpg/protocol/coreproto.pyx":117
 *                     # discard all messages until the sync message
 *                     if mtype == b'E':
 *                         self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 *                     elif mtype == b'Z':
 *                         self._parse_msg_ready_for_query()
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 117, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "asyncpg/protocol/coreproto.pyx":116
 *                 elif state == PROTOCOL_CANCELLED:
 *                     # discard all messages until the sync message
 *                     if mtype == b'E':             # <<<<<<<<<<<<<<
 *                         self._parse_msg_error_response(True)
 *                     elif mtype == b'Z':
*/
              break;
              case 'Z':

              /* "asyncpg/protocol/coreproto.pyx":119
 *                         self._parse_msg_error_response(True)
 *                     elif mtype == b'Z':
 *                         self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *                         self._push_result()
 *                     else:
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 119, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "asyncpg/protocol/coreproto.pyx":120
 *                     elif mtype == b'Z':
 *                         self._parse_msg_ready_for_query()
 *                         self._push_result()             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.buffer.discard_message()
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 120, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "asyncpg/protocol/coreproto.pyx":118
 *                     if mtype == b'E':
 *                         self._parse_msg_error_response(True)
 *                     elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *                         self._parse_msg_ready_for_query()
 *                         self._push_result()
*/
              break;
              default:

              /* "asyncpg/protocol/coreproto.pyx":122
 *                         self._push_result()
 *                     else:
 *                         self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_ERROR_CONSUME:
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 122, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              break;
            }

            /* "asyncpg/protocol/coreproto.pyx":114
 *                     self._process__copy_in_data(mtype)
 * 
 *                 elif state == PROTOCOL_CANCELLED:             # <<<<<<<<<<<<<<
 *                     # discard all messages until the sync message
 *                     if mtype == b'E':
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":124
 *                         self.buffer.discard_message()
 * 
 *                 elif state == PROTOCOL_ERROR_CONSUME:             # <<<<<<<<<<<<<<
 *                     # Error in protocol (on asyncpg side);
 *                     # discard all messages until sync message
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME);
          if (__pyx_t_3) {

            /* "asyncpg/protocol/coreproto.pyx":128
 *                     # discard all messages until sync message
 * 
 *                     if mtype == b'Z':             # <<<<<<<<<<<<<<
 *                         # Sync point, self to push the result
 *                         if self.result_type != RESULT_FAILED:
*/
            __pyx_t_3 = (__pyx_v_mtype == 'Z');
            if (__pyx_t_3) {

              /* "asyncpg/protocol/coreproto.pyx":130
 *                     if mtype == b'Z':
 *                         # Sync point, self to push the result
 *                         if self.result_type != RESULT_FAILED:             # <<<<<<<<<<<<<<
 *                             self.result_type = RESULT_FAILED
 *                             self.result = apg_exc.InternalClientError(
*/
              __pyx_t_3 = (__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED);
              if (__pyx_t_3) {

                /* "asyncpg/protocol/coreproto.pyx":131
 *                         # Sync point, self to push the result
 *                         if self.result_type != RESULT_FAILED:
 *                             self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                             self.result = apg_exc.InternalClientError(
 *                                 'unknown error in protocol implementation')
*/
                __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

                /* "asyncpg/protocol/coreproto.pyx":132
 *                         if self.result_type != RESULT_FAILED:
 *                             self.result_type = RESULT_FAILED
 *                             self.result = apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                                 'unknown error in protocol implementation')
 * 
*/
                __pyx_t_1 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 132, __pyx_L10_error)
                __Pyx_GOTREF(__pyx_t_10);
                __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 132, __pyx_L10_error)
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                __pyx_t_12 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_11))) {
                  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
                  assert(__pyx_t_1);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
                  __Pyx_INCREF(__pyx_t_1);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
                  __pyx_t_12 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_unknown_error_in_protocol_implem};
                  __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 132, __pyx_L10_error)
                  __Pyx_GOTREF(__pyx_t_9);
                }
                __Pyx_GIVEREF(__pyx_t_9);
                __Pyx_GOTREF(__pyx_v_self->result);
                __Pyx_DECREF(__pyx_v_self->result);
                __pyx_v_self->result = __pyx_t_9;
                __pyx_t_9 = 0;

                /* "asyncpg/protocol/coreproto.pyx":130
 *                     if mtype == b'Z':
 *                         # Sync point, self to push the result
 *                         if self.result_type != RESULT_FAILED:             # <<<<<<<<<<<<<<
 *                             self.result_type = RESULT_FAILED
 *                             self.result = apg_exc.InternalClientError(
*/
              }

              /* "asyncpg/protocol/coreproto.pyx":135
 *                                 'unknown error in protocol implementation')
 * 
 *                         self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *                         self._push_result()
 * 
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 135, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "asyncpg/protocol/coreproto.pyx":136
 * 
 *                         self._parse_msg_ready_for_query()
 *                         self._push_result()             # <<<<<<<<<<<<<<
 * 
 *                     else:
*/
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 136, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

              /* "asyncpg/protocol/coreproto.pyx":128
 *                     # discard all messages until sync message
 * 
 *                     if mtype == b'Z':             # <<<<<<<<<<<<<<
 *                         # Sync point, self to push the result
 *                         if self.result_type != RESULT_FAILED:
*/
              goto __pyx_L19;
            }

            /* "asyncpg/protocol/coreproto.pyx":139
 * 
 *                     else:
 *                         self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif state == PROTOCOL_TERMINATING:
*/
            /*else*/ {
              __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 139, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            }
            __pyx_L19:;

            /* "asyncpg/protocol/coreproto.pyx":124
 *                         self.buffer.discard_message()
 * 
 *                 elif state == PROTOCOL_ERROR_CONSUME:             # <<<<<<<<<<<<<<
 *                     # Error in protocol (on asyncpg side);
 *                     # discard all messages until sync message
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":141
 *                         self.buffer.discard_message()
 * 
 *                 elif state == PROTOCOL_TERMINATING:             # <<<<<<<<<<<<<<
 *                     # The connection is being terminated.
 *                     # discard all messages until connection
*/
          __pyx_t_3 = (__pyx_v_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING);
          if (likely(__pyx_t_3)) {

            /* "asyncpg/protocol/coreproto.pyx":145
 *                     # discard all messages until connection
 *                     # termination.
 *                     self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 else:
*/
            __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 145, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

            /* "asyncpg/protocol/coreproto.pyx":141
 *                         self.buffer.discard_message()
 * 
 *                 elif state == PROTOCOL_TERMINATING:             # <<<<<<<<<<<<<<
 *                     # The connection is being terminated.
 *                     # discard all messages until connection
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":148
 * 
 *                 else:
 *                     raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                         f'cannot process message {chr(mtype)!r}: '
 *                         f'protocol is in an unexpected state {state!r}.')
*/
          /*else*/ {
            __pyx_t_11 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 148, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 148, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "asyncpg/protocol/coreproto.pyx":149
 *                 else:
 *                     raise apg_exc.InternalClientError(
 *                         f'cannot process message {chr(mtype)!r}: '             # <<<<<<<<<<<<<<
 *                         f'protocol is in an unexpected state {state!r}.')
 * 
*/
            __pyx_t_1 = PyUnicode_FromOrdinal(__pyx_v_mtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 149, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_13 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(15, 149, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "asyncpg/protocol/coreproto.pyx":150
 *                     raise apg_exc.InternalClientError(
 *                         f'cannot process message {chr(mtype)!r}: '
 *                         f'protocol is in an unexpected state {state!r}.')             # <<<<<<<<<<<<<<
 * 
 *             except Exception as ex:
*/
            __pyx_t_1 = __Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_state, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 150, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_cannot_process_message;
            __pyx_t_14[1] = __pyx_t_13;
            __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_protocol_is_in_an_unexpected_st;
            __pyx_t_14[3] = __pyx_t_1;
            __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u__16;

            /* "asyncpg/protocol/coreproto.pyx":149
 *                 else:
 *                     raise apg_exc.InternalClientError(
 *                         f'cannot process message {chr(mtype)!r}: '             # <<<<<<<<<<<<<<
 *                         f'protocol is in an unexpected state {state!r}.')
 * 
*/
            __pyx_t_15 = __Pyx_PyUnicode_Join(__pyx_t_14, 5, 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
            if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 149, __pyx_L10_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_10))) {
              __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
              assert(__pyx_t_11);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_15};
              __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 148, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_9);
            }
            __Pyx_Raise(__pyx_t_9, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __PYX_ERR(15, 148, __pyx_L10_error)
          }
          __pyx_L18:;

          /* "asyncpg/protocol/coreproto.pyx":64
 *             state = self.state
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == b'S':
 *                     # ParameterStatus
*/
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L17_try_end;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "asyncpg/protocol/coreproto.pyx":152
 *                         f'protocol is in an unexpected state {state!r}.')
 * 
 *             except Exception as ex:             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = ex
*/
        __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_16) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._read_server_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_15) < 0) __PYX_ERR(15, 152, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_INCREF(__pyx_t_10);
          __pyx_v_ex = __pyx_t_10;
          /*try:*/ {

            /* "asyncpg/protocol/coreproto.pyx":153
 * 
 *             except Exception as ex:
 *                 self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                 self.result = ex
 * 
*/
            __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

            /* "asyncpg/protocol/coreproto.pyx":154
 *             except Exception as ex:
 *                 self.result_type = RESULT_FAILED
 *                 self.result = ex             # <<<<<<<<<<<<<<
 * 
 *                 if mtype == b'Z':
*/
            __Pyx_INCREF(__pyx_v_ex);
            __Pyx_GIVEREF(__pyx_v_ex);
            __Pyx_GOTREF(__pyx_v_self->result);
            __Pyx_DECREF(__pyx_v_self->result);
            __pyx_v_self->result = __pyx_v_ex;

            /* "asyncpg/protocol/coreproto.pyx":156
 *                 self.result = ex
 * 
 *                 if mtype == b'Z':             # <<<<<<<<<<<<<<
 *                     self._push_result()
 *                 else:
*/
            __pyx_t_3 = (__pyx_v_mtype == 'Z');
            if (__pyx_t_3) {

              /* "asyncpg/protocol/coreproto.pyx":157
 * 
 *                 if mtype == b'Z':
 *                     self._push_result()             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.state = PROTOCOL_ERROR_CONSUME
*/
              __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 157, __pyx_L26_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

              /* "asyncpg/protocol/coreproto.pyx":156
 *                 self.result = ex
 * 
 *                 if mtype == b'Z':             # <<<<<<<<<<<<<<
 *                     self._push_result()
 *                 else:
*/
              goto __pyx_L28;
            }

            /* "asyncpg/protocol/coreproto.pyx":159
 *                     self._push_result()
 *                 else:
 *                     self.state = PROTOCOL_ERROR_CONSUME             # <<<<<<<<<<<<<<
 * 
 *             finally:
*/
            /*else*/ {
              __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME;
            }
            __pyx_L28:;
          }

          /* "asyncpg/protocol/coreproto.pyx":152
 *                         f'protocol is in an unexpected state {state!r}.')
 * 
 *             except Exception as ex:             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = ex
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
              goto __pyx_L27;
            }
            __pyx_L26_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
              if ( unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __pyx_t_16 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
              __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
              __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
              goto __pyx_L12_except_error;
            }
            __pyx_L27:;
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          goto __pyx_L11_exception_handled;
        }
        goto __pyx_L12_except_error;

        /* "asyncpg/protocol/coreproto.pyx":64
 *             state = self.state
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == b'S':
 *                     # ParameterStatus
*/
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L8_error;
        __pyx_L11_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L17_try_end:;
      }
    }

    /* "asyncpg/protocol/coreproto.pyx":162
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__auth(self, char mtype):
*/
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_15 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L9;
      }
      __pyx_L8_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
        if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_24);
        __Pyx_XGOTREF(__pyx_t_23);
        __Pyx_XGOTREF(__pyx_t_22);
        __pyx_t_17 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_25 = __pyx_filename;
        {
          __pyx_t_15 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 162, __pyx_L36_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        }
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
        __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
        __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_25;
        goto __pyx_L1_error;
        __pyx_L36_error:;
        __Pyx_XGIVEREF(__pyx_t_24);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_24 = 0; __pyx_t_23 = 0; __pyx_t_22 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9:;
    }
  }

  /* "asyncpg/protocol/coreproto.pyx":51
 *         return self.xact_status in (PQTRANS_INTRANS, PQTRANS_INERROR)
 * 
 *     cdef _read_server_messages(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char mtype
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._read_server_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":164
 *                 self.buffer.finish_message()
 * 
 *     cdef _process__auth(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'R':
 *             # Authentication...
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_v_ex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__auth", 0);

  /* "asyncpg/protocol/coreproto.pyx":165
 * 
 *     cdef _process__auth(self, char mtype):
 *         if mtype == b'R':             # <<<<<<<<<<<<<<
 *             # Authentication...
 *             try:
*/
  switch (__pyx_v_mtype) {
    case 'R':

    /* "asyncpg/protocol/coreproto.pyx":167
 *         if mtype == b'R':
 *             # Authentication...
 *             try:             # <<<<<<<<<<<<<<
 *                 self._parse_msg_authentication()
 *             except Exception as ex:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      /*try:*/ {

        /* "asyncpg/protocol/coreproto.pyx":168
 *             # Authentication...
 *             try:
 *                 self._parse_msg_authentication()             # <<<<<<<<<<<<<<
 *             except Exception as ex:
 *                 # Exception in authentication parsing code
*/
        __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_authentication(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 168, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "asyncpg/protocol/coreproto.pyx":167
 *         if mtype == b'R':
 *             # Authentication...
 *             try:             # <<<<<<<<<<<<<<
 *                 self._parse_msg_authentication()
 *             except Exception as ex:
*/
      }

      /* "asyncpg/protocol/coreproto.pyx":181
 *                 self._push_result()
 *             else:
 *                 if self.result_type != RESULT_OK:             # <<<<<<<<<<<<<<
 *                     self.con_status = CONNECTION_BAD
 *                     self._push_result()
*/
      /*else:*/ {
        __pyx_t_5 = (__pyx_v_self->result_type != __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK);
        if (__pyx_t_5) {

          /* "asyncpg/protocol/coreproto.pyx":182
 *             else:
 *                 if self.result_type != RESULT_OK:
 *                     self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *                     self._push_result()
 * 
*/
          __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

          /* "asyncpg/protocol/coreproto.pyx":183
 *                 if self.result_type != RESULT_OK:
 *                     self.con_status = CONNECTION_BAD
 *                     self._push_result()             # <<<<<<<<<<<<<<
 * 
 *                 elif self.auth_msg is not None:
*/
          __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 183, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "asyncpg/protocol/coreproto.pyx":181
 *                 self._push_result()
 *             else:
 *                 if self.result_type != RESULT_OK:             # <<<<<<<<<<<<<<
 *                     self.con_status = CONNECTION_BAD
 *                     self._push_result()
*/
          goto __pyx_L9;
        }

        /* "asyncpg/protocol/coreproto.pyx":185
 *                     self._push_result()
 * 
 *                 elif self.auth_msg is not None:             # <<<<<<<<<<<<<<
 *                     # Server wants us to send auth data, so do that.
 *                     self._write(self.auth_msg)
*/
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 185, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = (__pyx_t_4 != Py_None);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_5) {

          /* "asyncpg/protocol/coreproto.pyx":187
 *                 elif self.auth_msg is not None:
 *                     # Server wants us to send auth data, so do that.
 *                     self._write(self.auth_msg)             # <<<<<<<<<<<<<<
 *                     self.auth_msg = None
 * 
*/
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 187, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 187, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "asyncpg/protocol/coreproto.pyx":188
 *                     # Server wants us to send auth data, so do that.
 *                     self._write(self.auth_msg)
 *                     self.auth_msg = None             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'K':
*/
          if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, Py_None) < (0)) __PYX_ERR(15, 188, __pyx_L5_except_error)

          /* "asyncpg/protocol/coreproto.pyx":185
 *                     self._push_result()
 * 
 *                 elif self.auth_msg is not None:             # <<<<<<<<<<<<<<
 *                     # Server wants us to send auth data, so do that.
 *                     self._write(self.auth_msg)
*/
        }
        __pyx_L9:;
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L8_try_end;
      __pyx_L3_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/coreproto.pyx":169
 *             try:
 *                 self._parse_msg_authentication()
 *             except Exception as ex:             # <<<<<<<<<<<<<<
 *                 # Exception in authentication parsing code
 *                 # is usually either malformed authentication data
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__auth", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(15, 169, __pyx_L5_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_ex = __pyx_t_4;
        /*try:*/ {

          /* "asyncpg/protocol/coreproto.pyx":174
 *                 # or missing support for cryptographic primitives
 *                 # in the hashlib module.
 *                 self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                 self.result = apg_exc.InternalClientError(
 *                     f"unexpected error while performing authentication: {ex}")
*/
          __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

          /* "asyncpg/protocol/coreproto.pyx":175
 *                 # in the hashlib module.
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     f"unexpected error while performing authentication: {ex}")
 *                 self.result.__cause__ = ex
*/
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 175, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 175, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "asyncpg/protocol/coreproto.pyx":176
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InternalClientError(
 *                     f"unexpected error while performing authentication: {ex}")             # <<<<<<<<<<<<<<
 *                 self.result.__cause__ = ex
 *                 self.con_status = CONNECTION_BAD
*/
          __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_ex, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 176, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_unexpected_error_while_performin, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(15, 176, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_14 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
            __pyx_t_14 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_13};
            __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 175, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_9);
          }

          /* "asyncpg/protocol/coreproto.pyx":175
 *                 # in the hashlib module.
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     f"unexpected error while performing authentication: {ex}")
 *                 self.result.__cause__ = ex
*/
          __Pyx_GIVEREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_v_self->result);
          __Pyx_DECREF(__pyx_v_self->result);
          __pyx_v_self->result = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "asyncpg/protocol/coreproto.pyx":177
 *                 self.result = apg_exc.InternalClientError(
 *                     f"unexpected error while performing authentication: {ex}")
 *                 self.result.__cause__ = ex             # <<<<<<<<<<<<<<
 *                 self.con_status = CONNECTION_BAD
 *                 self._push_result()
*/
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->result, __pyx_mstate_global->__pyx_n_u_cause, __pyx_v_ex) < (0)) __PYX_ERR(15, 177, __pyx_L15_error)

          /* "asyncpg/protocol/coreproto.pyx":178
 *                     f"unexpected error while performing authentication: {ex}")
 *                 self.result.__cause__ = ex
 *                 self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *                 self._push_result()
 *             else:
*/
          __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

          /* "asyncpg/protocol/coreproto.pyx":179
 *                 self.result.__cause__ = ex
 *                 self.con_status = CONNECTION_BAD
 *                 self._push_result()             # <<<<<<<<<<<<<<
 *             else:
 *                 if self.result_type != RESULT_OK:
*/
          __pyx_t_9 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 179, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }

        /* "asyncpg/protocol/coreproto.pyx":169
 *             try:
 *                 self._parse_msg_authentication()
 *             except Exception as ex:             # <<<<<<<<<<<<<<
 *                 # Exception in authentication parsing code
 *                 # is usually either malformed authentication data
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
            goto __pyx_L16;
          }
          __pyx_L15_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
            if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_7 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
            goto __pyx_L5_except_error;
          }
          __pyx_L16:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L4_exception_handled;
      }
      goto __pyx_L5_except_error;

      /* "asyncpg/protocol/coreproto.pyx":167
 *         if mtype == b'R':
 *             # Authentication...
 *             try:             # <<<<<<<<<<<<<<
 *                 self._parse_msg_authentication()
 *             except Exception as ex:
*/
      __pyx_L5_except_error:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      goto __pyx_L1_error;
      __pyx_L4_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_1);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
      __pyx_L8_try_end:;
    }

    /* "asyncpg/protocol/coreproto.pyx":165
 * 
 *     cdef _process__auth(self, char mtype):
 *         if mtype == b'R':             # <<<<<<<<<<<<<<
 *             # Authentication...
 *             try:
*/
    break;
    case 'K':

    /* "asyncpg/protocol/coreproto.pyx":192
 *         elif mtype == b'K':
 *             # BackendKeyData
 *             self._parse_msg_backend_key_data()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'E':
*/
    __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_backend_key_data(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/coreproto.pyx":190
 *                     self.auth_msg = None
 * 
 *         elif mtype == b'K':             # <<<<<<<<<<<<<<
 *             # BackendKeyData
 *             self._parse_msg_backend_key_data()
*/
    break;
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":196
 *         elif mtype == b'E':
 *             # ErrorResponse
 *             self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 *             self._push_result()
*/
    __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

    /* "asyncpg/protocol/coreproto.pyx":197
 *             # ErrorResponse
 *             self.con_status = CONNECTION_BAD
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/coreproto.pyx":198
 *             self.con_status = CONNECTION_BAD
 *             self._parse_msg_error_response(True)
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/coreproto.pyx":194
 *             self._parse_msg_backend_key_data()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self.con_status = CONNECTION_BAD
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":202
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self.con_status = CONNECTION_OK
 *             self._push_result()
*/
    __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/coreproto.pyx":203
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self.con_status = CONNECTION_OK             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK;

    /* "asyncpg/protocol/coreproto.pyx":204
 *             self._parse_msg_ready_for_query()
 *             self.con_status = CONNECTION_OK
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__prepare(self, char mtype):
*/
    __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/coreproto.pyx":200
 *             self._push_result()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":164
 *                 self.buffer.finish_message()
 * 
 *     cdef _process__auth(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'R':
 *             # Authentication...
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__auth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":206
 *             self._push_result()
 * 
 *     cdef _process__prepare(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b't':
 *             # Parameters description
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__prepare", 0);

  /* "asyncpg/protocol/coreproto.pyx":207
 * 
 *     cdef _process__prepare(self, char mtype):
 *         if mtype == b't':             # <<<<<<<<<<<<<<
 *             # Parameters description
 *             self.result_param_desc = self.buffer.consume_message()
*/
  switch (__pyx_v_mtype) {
    case 't':

    /* "asyncpg/protocol/coreproto.pyx":209
 *         if mtype == b't':
 *             # Parameters description
 *             self.result_param_desc = self.buffer.consume_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'1':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->result_param_desc);
    __Pyx_DECREF(__pyx_v_self->result_param_desc);
    __pyx_v_self->result_param_desc = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":207
 * 
 *     cdef _process__prepare(self, char mtype):
 *         if mtype == b't':             # <<<<<<<<<<<<<<
 *             # Parameters description
 *             self.result_param_desc = self.buffer.consume_message()
*/
    break;
    case '1':

    /* "asyncpg/protocol/coreproto.pyx":213
 *         elif mtype == b'1':
 *             # ParseComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'T':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":211
 *             self.result_param_desc = self.buffer.consume_message()
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete
 *             self.buffer.discard_message()
*/
    break;
    case 'T':

    /* "asyncpg/protocol/coreproto.pyx":217
 *         elif mtype == b'T':
 *             # Row description
 *             self.result_row_desc = self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_self->result_row_desc);
    __Pyx_DECREF(__pyx_v_self->result_row_desc);
    __pyx_v_self->result_row_desc = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":218
 *             # Row description
 *             self.result_row_desc = self.buffer.consume_message()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'E':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":215
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'T':             # <<<<<<<<<<<<<<
 *             # Row description
 *             self.result_row_desc = self.buffer.consume_message()
*/
    break;
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":222
 *         elif mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 *             # we don't send a sync during the parse/describe sequence
 *             # but send a FLUSH instead. If an error happens we need to
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":228
 *             # this effectively clears the error and we then wait until we get a
 *             # ready for new query message
 *             self._write(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *             self.state = PROTOCOL_ERROR_CONSUME
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":229
 *             # ready for new query message
 *             self._write(SYNC_MESSAGE)
 *             self.state = PROTOCOL_ERROR_CONSUME             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'n':
*/
    __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_ERROR_CONSUME;

    /* "asyncpg/protocol/coreproto.pyx":220
 *             self._push_result()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    break;
    case 'n':

    /* "asyncpg/protocol/coreproto.pyx":233
 *         elif mtype == b'n':
 *             # NoData
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":234
 *             # NoData
 *             self.buffer.discard_message()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__bind_execute(self, char mtype):
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":231
 *             self.state = PROTOCOL_ERROR_CONSUME
 * 
 *         elif mtype == b'n':             # <<<<<<<<<<<<<<
 *             # NoData
 *             self.buffer.discard_message()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":206
 *             self._push_result()
 * 
 *     cdef _process__prepare(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b't':
 *             # Parameters description
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":236
 *             self._push_result()
 * 
 *     cdef _process__bind_execute(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'D':
 *             # DataRow
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__bind_execute", 0);

  /* "asyncpg/protocol/coreproto.pyx":237
 * 
 *     cdef _process__bind_execute(self, char mtype):
 *         if mtype == b'D':             # <<<<<<<<<<<<<<
 *             # DataRow
 *             self._parse_data_msgs()
*/
  switch (__pyx_v_mtype) {
    case 'D':

    /* "asyncpg/protocol/coreproto.pyx":239
 *         if mtype == b'D':
 *             # DataRow
 *             self._parse_data_msgs()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b's':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":237
 * 
 *     cdef _process__bind_execute(self, char mtype):
 *         if mtype == b'D':             # <<<<<<<<<<<<<<
 *             # DataRow
 *             self._parse_data_msgs()
*/
    break;
    case 's':

    /* "asyncpg/protocol/coreproto.pyx":243
 *         elif mtype == b's':
 *             # PortalSuspended
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'C':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":241
 *             self._parse_data_msgs()
 * 
 *         elif mtype == b's':             # <<<<<<<<<<<<<<
 *             # PortalSuspended
 *             self.buffer.discard_message()
*/
    break;
    case 'C':

    /* "asyncpg/protocol/coreproto.pyx":247
 *         elif mtype == b'C':
 *             # CommandComplete
 *             self.result_execute_completed = True             # <<<<<<<<<<<<<<
 *             self._parse_msg_command_complete()
 * 
*/
    __pyx_v_self->result_execute_completed = 1;

    /* "asyncpg/protocol/coreproto.pyx":248
 *             # CommandComplete
 *             self.result_execute_completed = True
 *             self._parse_msg_command_complete()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'E':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":245
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self.result_execute_completed = True
*/
    break;
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":252
 *         elif mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'1':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":250
 *             self._parse_msg_command_complete()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    break;
    case '1':

    /* "asyncpg/protocol/coreproto.pyx":256
 *         elif mtype == b'1':
 *             # ParseComplete, in case `_bind_execute()` is reparsing
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'2':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":254
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete, in case `_bind_execute()` is reparsing
 *             self.buffer.discard_message()
*/
    break;
    case '2':

    /* "asyncpg/protocol/coreproto.pyx":260
 *         elif mtype == b'2':
 *             # BindComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":258
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'2':             # <<<<<<<<<<<<<<
 *             # BindComplete
 *             self.buffer.discard_message()
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":264
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":265
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'I':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":262
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    case 'I':

    /* "asyncpg/protocol/coreproto.pyx":269
 *         elif mtype == b'I':
 *             # EmptyQueryResponse
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__bind_execute_many(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":267
 *             self._push_result()
 * 
 *         elif mtype == b'I':             # <<<<<<<<<<<<<<
 *             # EmptyQueryResponse
 *             self.buffer.discard_message()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":236
 *             self._push_result()
 * 
 *     cdef _process__bind_execute(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'D':
 *             # DataRow
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":271
 *             self.buffer.discard_message()
 * 
 *     cdef _process__bind_execute_many(self, char mtype):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__bind_execute_many", 0);

  /* "asyncpg/protocol/coreproto.pyx":274
 *         cdef WriteBuffer buf
 * 
 *         if mtype == b'D':             # <<<<<<<<<<<<<<
 *             # DataRow
 *             self._parse_data_msgs()
*/
  __pyx_t_1 = (__pyx_v_mtype == 'D');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":276
 *         if mtype == b'D':
 *             # DataRow
 *             self._parse_data_msgs()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b's':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":274
 *         cdef WriteBuffer buf
 * 
 *         if mtype == b'D':             # <<<<<<<<<<<<<<
 *             # DataRow
 *             self._parse_data_msgs()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":278
 *             self._parse_data_msgs()
 * 
 *         elif mtype == b's':             # <<<<<<<<<<<<<<
 *             # PortalSuspended
 *             self.buffer.discard_message()
*/
  __pyx_t_1 = (__pyx_v_mtype == 's');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":280
 *         elif mtype == b's':
 *             # PortalSuspended
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'C':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":278
 *             self._parse_data_msgs()
 * 
 *         elif mtype == b's':             # <<<<<<<<<<<<<<
 *             # PortalSuspended
 *             self.buffer.discard_message()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":282
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self._parse_msg_command_complete()
*/
  __pyx_t_1 = (__pyx_v_mtype == 'C');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":284
 *         elif mtype == b'C':
 *             # CommandComplete
 *             self._parse_msg_command_complete()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'E':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":282
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self._parse_msg_command_complete()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":286
 *             self._parse_msg_command_complete()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
  __pyx_t_1 = (__pyx_v_mtype == 'E');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":288
 *         elif mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'1':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":286
 *             self._parse_msg_command_complete()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":290
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete, in case `_bind_execute_many()` is reparsing
 *             self.buffer.discard_message()
*/
  __pyx_t_1 = (__pyx_v_mtype == '1');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":292
 *         elif mtype == b'1':
 *             # ParseComplete, in case `_bind_execute_many()` is reparsing
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'2':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":290
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete, in case `_bind_execute_many()` is reparsing
 *             self.buffer.discard_message()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":294
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'2':             # <<<<<<<<<<<<<<
 *             # BindComplete
 *             self.buffer.discard_message()
*/
  __pyx_t_1 = (__pyx_v_mtype == '2');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":296
 *         elif mtype == b'2':
 *             # BindComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":294
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'2':             # <<<<<<<<<<<<<<
 *             # BindComplete
 *             self.buffer.discard_message()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":298
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
  __pyx_t_1 = (__pyx_v_mtype == 'Z');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":300
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":301
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'I':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":298
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":303
 *             self._push_result()
 * 
 *         elif mtype == b'I':             # <<<<<<<<<<<<<<
 *             # EmptyQueryResponse
 *             self.buffer.discard_message()
*/
  __pyx_t_1 = (__pyx_v_mtype == 'I');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":305
 *         elif mtype == b'I':
 *             # EmptyQueryResponse
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'1':
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":303
 *             self._push_result()
 * 
 *         elif mtype == b'I':             # <<<<<<<<<<<<<<
 *             # EmptyQueryResponse
 *             self.buffer.discard_message()
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":307
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete
 *             self.buffer.discard_message()
*/
  __pyx_t_1 = (__pyx_v_mtype == '1');
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":309
 *         elif mtype == b'1':
 *             # ParseComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__bind(self, char mtype):
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":307
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'1':             # <<<<<<<<<<<<<<
 *             # ParseComplete
 *             self.buffer.discard_message()
*/
  }
  __pyx_L3:;

  /* "asyncpg/protocol/coreproto.pyx":271
 *             self.buffer.discard_message()
 * 
 *     cdef _process__bind_execute_many(self, char mtype):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

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

/* "asyncpg/protocol/coreproto.pyx":311
 *             self.buffer.discard_message()
 * 
 *     cdef _process__bind(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             # ErrorResponse
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__bind", 0);

  /* "asyncpg/protocol/coreproto.pyx":312
 * 
 *     cdef _process__bind(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":314
 *         if mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'2':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":312
 * 
 *     cdef _process__bind(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    break;
    case '2':

    /* "asyncpg/protocol/coreproto.pyx":318
 *         elif mtype == b'2':
 *             # BindComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":316
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'2':             # <<<<<<<<<<<<<<
 *             # BindComplete
 *             self.buffer.discard_message()
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":322
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":323
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__close_stmt_portal(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":320
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":311
 *             self.buffer.discard_message()
 * 
 *     cdef _process__bind(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             # ErrorResponse
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":325
 *             self._push_result()
 * 
 *     cdef _process__close_stmt_portal(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             # ErrorResponse
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__close_stmt_portal", 0);

  /* "asyncpg/protocol/coreproto.pyx":326
 * 
 *     cdef _process__close_stmt_portal(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":328
 *         if mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'3':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":326
 * 
 *     cdef _process__close_stmt_portal(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    break;
    case '3':

    /* "asyncpg/protocol/coreproto.pyx":332
 *         elif mtype == b'3':
 *             # CloseComplete
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":330
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'3':             # <<<<<<<<<<<<<<
 *             # CloseComplete
 *             self.buffer.discard_message()
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":336
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":337
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__simple_query(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":334
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":325
 *             self._push_result()
 * 
 *     cdef _process__close_stmt_portal(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             # ErrorResponse
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__close_stmt_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":339
 *             self._push_result()
 * 
 *     cdef _process__simple_query(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype in {b'D', b'I', b'T'}:
 *             # 'D' - DataRow
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__simple_query", 0);

  /* "asyncpg/protocol/coreproto.pyx":340
 * 
 *     cdef _process__simple_query(self, char mtype):
 *         if mtype in {b'D', b'I', b'T'}:             # <<<<<<<<<<<<<<
 *             # 'D' - DataRow
 *             # 'I' - EmptyQueryResponse
*/
  switch (__pyx_v_mtype) {
    case 'D':
    case 'I':
    case 'T':

    /* "asyncpg/protocol/coreproto.pyx":344
 *             # 'I' - EmptyQueryResponse
 *             # 'T' - RowDescription
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'E':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":340
 * 
 *     cdef _process__simple_query(self, char mtype):
 *         if mtype in {b'D', b'I', b'T'}:             # <<<<<<<<<<<<<<
 *             # 'D' - DataRow
 *             # 'I' - EmptyQueryResponse
*/
    break;
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":348
 *         elif mtype == b'E':
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":346
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'E':             # <<<<<<<<<<<<<<
 *             # ErrorResponse
 *             self._parse_msg_error_response(True)
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":352
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":353
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'C':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":350
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    case 'C':

    /* "asyncpg/protocol/coreproto.pyx":357
 *         elif mtype == b'C':
 *             # CommandComplete
 *             self._parse_msg_command_complete()             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":355
 *             self._push_result()
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self._parse_msg_command_complete()
*/
    break;
    default:

    /* "asyncpg/protocol/coreproto.pyx":361
 *         else:
 *             # We don't really care about COPY IN etc
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__copy_out(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    break;
  }

  /* "asyncpg/protocol/coreproto.pyx":339
 *             self._push_result()
 * 
 *     cdef _process__simple_query(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype in {b'D', b'I', b'T'}:
 *             # 'D' - DataRow
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":363
 *             self.buffer.discard_message()
 * 
 *     cdef _process__copy_out(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__copy_out", 0);

  /* "asyncpg/protocol/coreproto.pyx":364
 * 
 *     cdef _process__copy_out(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":365
 *     cdef _process__copy_out(self, char mtype):
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'H':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":364
 * 
 *     cdef _process__copy_out(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
    break;
    case 'H':

    /* "asyncpg/protocol/coreproto.pyx":369
 *         elif mtype == b'H':
 *             # CopyOutResponse
 *             self._set_state(PROTOCOL_COPY_OUT_DATA)             # <<<<<<<<<<<<<<
 *             self.buffer.discard_message()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":370
 *             # CopyOutResponse
 *             self._set_state(PROTOCOL_COPY_OUT_DATA)
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":367
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'H':             # <<<<<<<<<<<<<<
 *             # CopyOutResponse
 *             self._set_state(PROTOCOL_COPY_OUT_DATA)
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":374
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":375
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__copy_out_data(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":372
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":363
 *             self.buffer.discard_message()
 * 
 *     cdef _process__copy_out(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":377
 *             self._push_result()
 * 
 *     cdef _process__copy_out_data(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__copy_out_data", 0);

  /* "asyncpg/protocol/coreproto.pyx":378
 * 
 *     cdef _process__copy_out_data(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":379
 *     cdef _process__copy_out_data(self, char mtype):
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'd':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":378
 * 
 *     cdef _process__copy_out_data(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
    break;
    case 'd':

    /* "asyncpg/protocol/coreproto.pyx":383
 *         elif mtype == b'd':
 *             # CopyData
 *             self._parse_copy_data_msgs()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'c':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_copy_data_msgs(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":381
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'd':             # <<<<<<<<<<<<<<
 *             # CopyData
 *             self._parse_copy_data_msgs()
*/
    break;
    case 'c':

    /* "asyncpg/protocol/coreproto.pyx":387
 *         elif mtype == b'c':
 *             # CopyDone
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 *             self._set_state(PROTOCOL_COPY_OUT_DONE)
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":388
 *             # CopyDone
 *             self.buffer.discard_message()
 *             self._set_state(PROTOCOL_COPY_OUT_DONE)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'C':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":385
 *             self._parse_copy_data_msgs()
 * 
 *         elif mtype == b'c':             # <<<<<<<<<<<<<<
 *             # CopyDone
 *             self.buffer.discard_message()
*/
    break;
    case 'C':

    /* "asyncpg/protocol/coreproto.pyx":392
 *         elif mtype == b'C':
 *             # CommandComplete
 *             self._parse_msg_command_complete()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":390
 *             self._set_state(PROTOCOL_COPY_OUT_DONE)
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self._parse_msg_command_complete()
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":396
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":397
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__copy_in(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":394
 *             self._parse_msg_command_complete()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":377
 *             self._push_result()
 * 
 *     cdef _process__copy_out_data(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_out_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":399
 *             self._push_result()
 * 
 *     cdef _process__copy_in(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__copy_in", 0);

  /* "asyncpg/protocol/coreproto.pyx":400
 * 
 *     cdef _process__copy_in(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":401
 *     cdef _process__copy_in(self, char mtype):
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'G':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":400
 * 
 *     cdef _process__copy_in(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
    break;
    case 'G':

    /* "asyncpg/protocol/coreproto.pyx":405
 *         elif mtype == b'G':
 *             # CopyInResponse
 *             self._set_state(PROTOCOL_COPY_IN_DATA)             # <<<<<<<<<<<<<<
 *             self.buffer.discard_message()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":406
 *             # CopyInResponse
 *             self._set_state(PROTOCOL_COPY_IN_DATA)
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":403
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'G':             # <<<<<<<<<<<<<<
 *             # CopyInResponse
 *             self._set_state(PROTOCOL_COPY_IN_DATA)
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":410
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":411
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _process__copy_in_data(self, char mtype):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":408
 *             self.buffer.discard_message()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":399
 *             self._push_result()
 * 
 *     cdef _process__copy_in(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":413
 *             self._push_result()
 * 
 *     cdef _process__copy_in_data(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, char __pyx_v_mtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_process__copy_in_data", 0);

  /* "asyncpg/protocol/coreproto.pyx":414
 * 
 *     cdef _process__copy_in_data(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
  switch (__pyx_v_mtype) {
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":415
 *     cdef _process__copy_in_data(self, char mtype):
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'C':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_error_response(__pyx_v_self, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":414
 * 
 *     cdef _process__copy_in_data(self, char mtype):
 *         if mtype == b'E':             # <<<<<<<<<<<<<<
 *             self._parse_msg_error_response(True)
 * 
*/
    break;
    case 'C':

    /* "asyncpg/protocol/coreproto.pyx":419
 *         elif mtype == b'C':
 *             # CommandComplete
 *             self._parse_msg_command_complete()             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == b'Z':
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_command_complete(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":417
 *             self._parse_msg_error_response(True)
 * 
 *         elif mtype == b'C':             # <<<<<<<<<<<<<<
 *             # CommandComplete
 *             self._parse_msg_command_complete()
*/
    break;
    case 'Z':

    /* "asyncpg/protocol/coreproto.pyx":423
 *         elif mtype == b'Z':
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()             # <<<<<<<<<<<<<<
 *             self._push_result()
 * 
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_parse_msg_ready_for_query(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":424
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
 *             self._push_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_command_complete(self):
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":421
 *             self._parse_msg_command_complete()
 * 
 *         elif mtype == b'Z':             # <<<<<<<<<<<<<<
 *             # ReadyForQuery
 *             self._parse_msg_ready_for_query()
*/
    break;
    default: break;
  }

  /* "asyncpg/protocol/coreproto.pyx":413
 *             self._push_result()
 * 
 *     cdef _process__copy_in_data(self, char mtype):             # <<<<<<<<<<<<<<
 *         if mtype == b'E':
 *             self._parse_msg_error_response(True)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._process__copy_in_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":426
 *             self._push_result()
 * 
 *     cdef _parse_msg_command_complete(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             const char* cbuf
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  char const *__pyx_v_cbuf;
  Py_ssize_t __pyx_v_cbuf_len;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__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;
  __Pyx_RefNannySetupContext("_parse_msg_command_complete", 0);

  /* "asyncpg/protocol/coreproto.pyx":431
 *             ssize_t cbuf_len
 * 
 *         cbuf = self.buffer.try_consume_message(&cbuf_len)             # <<<<<<<<<<<<<<
 *         if cbuf != NULL and cbuf_len > 0:
 *             msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->try_consume_message(__pyx_v_self->buffer, (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 431, __pyx_L1_error)
  __pyx_v_cbuf = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":432
 * 
 *         cbuf = self.buffer.try_consume_message(&cbuf_len)
 *         if cbuf != NULL and cbuf_len > 0:             # <<<<<<<<<<<<<<
 *             msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1)
 *         else:
*/
  __pyx_t_3 = (__pyx_v_cbuf != NULL);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_cbuf_len > 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/coreproto.pyx":433
 *         cbuf = self.buffer.try_consume_message(&cbuf_len)
 *         if cbuf != NULL and cbuf_len > 0:
 *             msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1)             # <<<<<<<<<<<<<<
 *         else:
 *             msg = self.buffer.read_null_str()
*/
    __pyx_t_4 = PyBytes_FromStringAndSize(__pyx_v_cbuf, (__pyx_v_cbuf_len - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_msg = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "asyncpg/protocol/coreproto.pyx":432
 * 
 *         cbuf = self.buffer.try_consume_message(&cbuf_len)
 *         if cbuf != NULL and cbuf_len > 0:             # <<<<<<<<<<<<<<
 *             msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":435
 *             msg = cpython.PyBytes_FromStringAndSize(cbuf, cbuf_len - 1)
 *         else:
 *             msg = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 *         self.result_status_msg = msg
 * 
*/
  /*else*/ {
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_msg = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/coreproto.pyx":436
 *         else:
 *             msg = self.buffer.read_null_str()
 *         self.result_status_msg = msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_copy_data_msgs(self):
*/
  __pyx_t_4 = __pyx_v_msg;
  __Pyx_INCREF(__pyx_t_4);
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(15, 436, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->result_status_msg);
  __Pyx_DECREF(__pyx_v_self->result_status_msg);
  __pyx_v_self->result_status_msg = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":426
 *             self._push_result()
 * 
 *     cdef _parse_msg_command_complete(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             const char* cbuf
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_command_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":438
 *         self.result_status_msg = msg
 * 
 *     cdef _parse_copy_data_msgs(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_copy_data_msgs", 0);

  /* "asyncpg/protocol/coreproto.pyx":440
 *     cdef _parse_copy_data_msgs(self):
 *         cdef:
 *             ReadBuffer buf = self.buffer             # <<<<<<<<<<<<<<
 * 
 *         self.result = buf.consume_messages(b'd')
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":442
 *             ReadBuffer buf = self.buffer
 * 
 *         self.result = buf.consume_messages(b'd')             # <<<<<<<<<<<<<<
 * 
 *         # By this point we have consumed all CopyData messages
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->consume_messages(__pyx_v_buf, 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":451
 *         # we must not push the result here and let the
 *         # _process__copy_out_data subprotocol do the job.
 *         if not buf.take_message():             # <<<<<<<<<<<<<<
 *             self._on_result()
 *             self.result = None
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->take_message(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(15, 451, __pyx_L1_error)
  __pyx_t_3 = (!(__pyx_t_2 != 0));
  if (__pyx_t_3) {

    /* "asyncpg/protocol/coreproto.pyx":452
 *         # _process__copy_out_data subprotocol do the job.
 *         if not buf.take_message():
 *             self._on_result()             # <<<<<<<<<<<<<<
 *             self.result = None
 *         else:
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":453
 *         if not buf.take_message():
 *             self._on_result()
 *             self.result = None             # <<<<<<<<<<<<<<
 *         else:
 *             # If there is a message in the buffer, put it back to
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->result);
    __Pyx_DECREF(__pyx_v_self->result);
    __pyx_v_self->result = Py_None;

    /* "asyncpg/protocol/coreproto.pyx":451
 *         # we must not push the result here and let the
 *         # _process__copy_out_data subprotocol do the job.
 *         if not buf.take_message():             # <<<<<<<<<<<<<<
 *             self._on_result()
 *             self.result = None
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":457
 *             # If there is a message in the buffer, put it back to
 *             # be processed by the next protocol iteration.
 *             buf.put_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_copy_data_msg(self, object data):
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->put_message(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(15, 457, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "asyncpg/protocol/coreproto.pyx":438
 *         self.result_status_msg = msg
 * 
 *     cdef _parse_copy_data_msgs(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_copy_data_msgs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":459
 *             buf.put_message()
 * 
 *     cdef _write_copy_data_msg(self, object data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_data) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_mview = 0;
  Py_buffer *__pyx_v_pybuf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_copy_data_msg", 0);

  /* "asyncpg/protocol/coreproto.pyx":465
 *             Py_buffer *pybuf
 * 
 *         mview = cpythonx.PyMemoryView_GetContiguous(             # <<<<<<<<<<<<<<
 *             data, cpython.PyBUF_READ, b'C')
 * 
*/
  __pyx_t_1 = PyMemoryView_GetContiguous(__pyx_v_data, PyBUF_READ, 'C'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_mview = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":468
 *             data, cpython.PyBUF_READ, b'C')
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview)
 * 
*/
  /*try:*/ {

    /* "asyncpg/protocol/coreproto.pyx":469
 * 
 *         try:
 *             pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview)             # <<<<<<<<<<<<<<
 * 
 *             buf = WriteBuffer.new_message(b'd')
*/
    __pyx_v_pybuf = PyMemoryView_GET_BUFFER(__pyx_v_mview);

    /* "asyncpg/protocol/coreproto.pyx":471
 *             pybuf = cpythonx.PyMemoryView_GET_BUFFER(mview)
 * 
 *             buf = WriteBuffer.new_message(b'd')             # <<<<<<<<<<<<<<
 *             buf.write_cstr(<const char *>pybuf.buf, pybuf.len)
 *             buf.end_message()
*/
    __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('d')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 471, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":472
 * 
 *             buf = WriteBuffer.new_message(b'd')
 *             buf.write_cstr(<const char *>pybuf.buf, pybuf.len)             # <<<<<<<<<<<<<<
 *             buf.end_message()
 *         finally:
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_cstr(__pyx_v_buf, ((char const *)__pyx_v_pybuf->buf), __pyx_v_pybuf->len); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 472, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":473
 *             buf = WriteBuffer.new_message(b'd')
 *             buf.write_cstr(<const char *>pybuf.buf, pybuf.len)
 *             buf.end_message()             # <<<<<<<<<<<<<<
 *         finally:
 *             mview.release()
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 473, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "asyncpg/protocol/coreproto.pyx":475
 *             buf.end_message()
 *         finally:
 *             mview.release()             # <<<<<<<<<<<<<<
 * 
 *         self._write(buf)
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_2 = __pyx_v_mview;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_release, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 475, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        __pyx_t_2 = __pyx_v_mview;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_release, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 475, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "asyncpg/protocol/coreproto.pyx":477
 *             mview.release()
 * 
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_copy_done_msg(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":459
 *             buf.put_message()
 * 
 *     cdef _write_copy_data_msg(self, object data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_data_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_mview);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":479
 *         self._write(buf)
 * 
 *     cdef _write_copy_done_msg(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_copy_done_msg", 0);

  /* "asyncpg/protocol/coreproto.pyx":483
 *             WriteBuffer buf
 * 
 *         buf = WriteBuffer.new_message(b'c')             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('c')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":484
 * 
 *         buf = WriteBuffer.new_message(b'c')
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":485
 *         buf = WriteBuffer.new_message(b'c')
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_copy_fail_msg(self, str cause):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":479
 *         self._write(buf)
 * 
 *     cdef _write_copy_done_msg(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_done_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":487
 *         self._write(buf)
 * 
 *     cdef _write_copy_fail_msg(self, str cause):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_cause) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write_copy_fail_msg", 0);

  /* "asyncpg/protocol/coreproto.pyx":491
 *             WriteBuffer buf
 * 
 *         buf = WriteBuffer.new_message(b'f')             # <<<<<<<<<<<<<<
 *         buf.write_str(cause or '', self.encoding)
 *         buf.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('f')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":492
 * 
 *         buf = WriteBuffer.new_message(b'f')
 *         buf.write_str(cause or '', self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cause); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 492, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_cause);
    __pyx_t_1 = __pyx_v_cause;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
  __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_L3_bool_binop_done:;
  __pyx_t_3 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":493
 *         buf = WriteBuffer.new_message(b'f')
 *         buf.write_str(cause or '', self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":494
 *         buf.write_str(cause or '', self.encoding)
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_data_msgs(self):
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":487
 *         self._write(buf)
 * 
 *     cdef _write_copy_fail_msg(self, str cause):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write_copy_fail_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":496
 *         self._write(buf)
 * 
 *     cdef _parse_data_msgs(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_rows = 0;
  __pyx_t_7asyncpg_8protocol_8protocol_decode_row_method __pyx_v_decoder;
  __pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method __pyx_v_try_consume_message;
  __pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method __pyx_v_take_message_type;
  char const *__pyx_v_cbuf;
  Py_ssize_t __pyx_v_cbuf_len;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_mem = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int32_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  char const *__pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_data_msgs", 0);

  /* "asyncpg/protocol/coreproto.pyx":498
 *     cdef _parse_data_msgs(self):
 *         cdef:
 *             ReadBuffer buf = self.buffer             # <<<<<<<<<<<<<<
 *             list rows
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":501
 *             list rows
 * 
 *             decode_row_method decoder = <decode_row_method>self._decode_row             # <<<<<<<<<<<<<<
 *             pgproto.try_consume_message_method try_consume_message = \
 *                 <pgproto.try_consume_message_method>buf.try_consume_message
*/
  __pyx_v_decoder = ((__pyx_t_7asyncpg_8protocol_8protocol_decode_row_method)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_decode_row);

  /* "asyncpg/protocol/coreproto.pyx":503
 *             decode_row_method decoder = <decode_row_method>self._decode_row
 *             pgproto.try_consume_message_method try_consume_message = \
 *                 <pgproto.try_consume_message_method>buf.try_consume_message             # <<<<<<<<<<<<<<
 *             pgproto.take_message_type_method take_message_type = \
 *                 <pgproto.take_message_type_method>buf.take_message_type
*/
  __pyx_v_try_consume_message = ((__pyx_t_7asyncpg_7pgproto_7pgproto_try_consume_message_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->try_consume_message);

  /* "asyncpg/protocol/coreproto.pyx":505
 *                 <pgproto.try_consume_message_method>buf.try_consume_message
 *             pgproto.take_message_type_method take_message_type = \
 *                 <pgproto.take_message_type_method>buf.take_message_type             # <<<<<<<<<<<<<<
 * 
 *             const char* cbuf
*/
  __pyx_v_take_message_type = ((__pyx_t_7asyncpg_7pgproto_7pgproto_take_message_type_method)((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->take_message_type);

  /* "asyncpg/protocol/coreproto.pyx":512
 *             bytes mem
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if buf.get_message_type() != b'D':
 *                 raise apg_exc.InternalClientError(
*/
  __pyx_t_2 = (PG_DEBUG != 0);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/coreproto.pyx":513
 * 
 *         if PG_DEBUG:
 *             if buf.get_message_type() != b'D':             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_parse_data_msgs: first message is not "D"')
*/
    __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 513, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 'D');
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/coreproto.pyx":514
 *         if PG_DEBUG:
 *             if buf.get_message_type() != b'D':
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     '_parse_data_msgs: first message is not "D"')
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_first_message_i};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 514, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(15, 514, __pyx_L1_error)

      /* "asyncpg/protocol/coreproto.pyx":513
 * 
 *         if PG_DEBUG:
 *             if buf.get_message_type() != b'D':             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_parse_data_msgs: first message is not "D"')
*/
    }

    /* "asyncpg/protocol/coreproto.pyx":512
 *             bytes mem
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if buf.get_message_type() != b'D':
 *                 raise apg_exc.InternalClientError(
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":517
 *                     '_parse_data_msgs: first message is not "D"')
 * 
 *         if self._discard_data:             # <<<<<<<<<<<<<<
 *             while take_message_type(buf, b'D'):
 *                 buf.discard_message()
*/
  if (__pyx_v_self->_discard_data) {

    /* "asyncpg/protocol/coreproto.pyx":518
 * 
 *         if self._discard_data:
 *             while take_message_type(buf, b'D'):             # <<<<<<<<<<<<<<
 *                 buf.discard_message()
 *             return
*/
    while (1) {
      __pyx_t_8 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_8 == ((int32_t)-1))) __PYX_ERR(15, 518, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_8 != 0);
      if (!__pyx_t_2) break;

      /* "asyncpg/protocol/coreproto.pyx":519
 *         if self._discard_data:
 *             while take_message_type(buf, b'D'):
 *                 buf.discard_message()             # <<<<<<<<<<<<<<
 *             return
 * 
*/
      __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->discard_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "asyncpg/protocol/coreproto.pyx":520
 *             while take_message_type(buf, b'D'):
 *                 buf.discard_message()
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if PG_DEBUG:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/coreproto.pyx":517
 *                     '_parse_data_msgs: first message is not "D"')
 * 
 *         if self._discard_data:             # <<<<<<<<<<<<<<
 *             while take_message_type(buf, b'D'):
 *                 buf.discard_message()
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":522
 *             return
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if type(self.result) is not list:
 *                 raise apg_exc.InternalClientError(
*/
  __pyx_t_2 = (PG_DEBUG != 0);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/coreproto.pyx":523
 * 
 *         if PG_DEBUG:
 *             if type(self.result) is not list:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_parse_data_msgs: result is not a list, but {!r}'.
*/
    __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_self->result)) != ((PyObject *)(&PyList_Type)));
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/coreproto.pyx":524
 *         if PG_DEBUG:
 *             if type(self.result) is not list:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     '_parse_data_msgs: result is not a list, but {!r}'.
 *                     format(self.result))
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/coreproto.pyx":526
 *                 raise apg_exc.InternalClientError(
 *                     '_parse_data_msgs: result is not a list, but {!r}'.
 *                     format(self.result))             # <<<<<<<<<<<<<<
 * 
 *         rows = self.result
*/
      __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_parse_data_msgs_result_is_not_a;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_self->result};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 524, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(15, 524, __pyx_L1_error)

      /* "asyncpg/protocol/coreproto.pyx":523
 * 
 *         if PG_DEBUG:
 *             if type(self.result) is not list:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_parse_data_msgs: result is not a list, but {!r}'.
*/
    }

    /* "asyncpg/protocol/coreproto.pyx":522
 *             return
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if type(self.result) is not list:
 *                 raise apg_exc.InternalClientError(
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":528
 *                     format(self.result))
 * 
 *         rows = self.result             # <<<<<<<<<<<<<<
 *         while take_message_type(buf, b'D'):
 *             cbuf = try_consume_message(buf, &cbuf_len)
*/
  __pyx_t_1 = __pyx_v_self->result;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(15, 528, __pyx_L1_error)
  __pyx_v_rows = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":529
 * 
 *         rows = self.result
 *         while take_message_type(buf, b'D'):             # <<<<<<<<<<<<<<
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf != NULL:
*/
  while (1) {
    __pyx_t_8 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_8 == ((int32_t)-1))) __PYX_ERR(15, 529, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_8 != 0);
    if (!__pyx_t_2) break;

    /* "asyncpg/protocol/coreproto.pyx":530
 *         rows = self.result
 *         while take_message_type(buf, b'D'):
 *             cbuf = try_consume_message(buf, &cbuf_len)             # <<<<<<<<<<<<<<
 *             if cbuf != NULL:
 *                 row = decoder(self, cbuf, cbuf_len)
*/
    __pyx_t_10 = __pyx_v_try_consume_message(((PyObject *)__pyx_v_buf), (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 530, __pyx_L1_error)
    __pyx_v_cbuf = __pyx_t_10;

    /* "asyncpg/protocol/coreproto.pyx":531
 *         while take_message_type(buf, b'D'):
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf != NULL:             # <<<<<<<<<<<<<<
 *                 row = decoder(self, cbuf, cbuf_len)
 *             else:
*/
    __pyx_t_2 = (__pyx_v_cbuf != NULL);
    if (__pyx_t_2) {

      /* "asyncpg/protocol/coreproto.pyx":532
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf != NULL:
 *                 row = decoder(self, cbuf, cbuf_len)             # <<<<<<<<<<<<<<
 *             else:
 *                 mem = buf.consume_message()
*/
      __pyx_t_1 = __pyx_v_decoder(((PyObject *)__pyx_v_self), __pyx_v_cbuf, __pyx_v_cbuf_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/coreproto.pyx":531
 *         while take_message_type(buf, b'D'):
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf != NULL:             # <<<<<<<<<<<<<<
 *                 row = decoder(self, cbuf, cbuf_len)
 *             else:
*/
      goto __pyx_L12;
    }

    /* "asyncpg/protocol/coreproto.pyx":534
 *                 row = decoder(self, cbuf, cbuf_len)
 *             else:
 *                 mem = buf.consume_message()             # <<<<<<<<<<<<<<
 *                 row = decoder(
 *                     self,
*/
    /*else*/ {
      __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->consume_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_mem, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/coreproto.pyx":535
 *             else:
 *                 mem = buf.consume_message()
 *                 row = decoder(             # <<<<<<<<<<<<<<
 *                     self,
 *                     cpython.PyBytes_AS_STRING(mem),
*/
      __pyx_t_1 = __pyx_v_decoder(((PyObject *)__pyx_v_self), PyBytes_AS_STRING(__pyx_v_mem), PyBytes_GET_SIZE(__pyx_v_mem)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L12:;

    /* "asyncpg/protocol/coreproto.pyx":540
 *                     cpython.PyBytes_GET_SIZE(mem))
 * 
 *             cpython.PyList_Append(rows, row)             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_backend_key_data(self):
*/
    __pyx_t_11 = PyList_Append(__pyx_v_rows, __pyx_v_row); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(15, 540, __pyx_L1_error)
  }

  /* "asyncpg/protocol/coreproto.pyx":496
 *         self._write(buf)
 * 
 *     cdef _parse_data_msgs(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_data_msgs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_rows);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_mem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":542
 *             cpython.PyList_Append(rows, row)
 * 
 *     cdef _parse_msg_backend_key_data(self):             # <<<<<<<<<<<<<<
 *         self.backend_pid = self.buffer.read_int32()
 *         self.backend_secret = self.buffer.read_int32()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_msg_backend_key_data", 0);

  /* "asyncpg/protocol/coreproto.pyx":543
 * 
 *     cdef _parse_msg_backend_key_data(self):
 *         self.backend_pid = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         self.backend_secret = self.buffer.read_int32()
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 543, __pyx_L1_error)
  __pyx_v_self->backend_pid = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":544
 *     cdef _parse_msg_backend_key_data(self):
 *         self.backend_pid = self.buffer.read_int32()
 *         self.backend_secret = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_parameter_status(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 544, __pyx_L1_error)
  __pyx_v_self->backend_secret = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":542
 *             cpython.PyList_Append(rows, row)
 * 
 *     cdef _parse_msg_backend_key_data(self):             # <<<<<<<<<<<<<<
 *         self.backend_pid = self.buffer.read_int32()
 *         self.backend_secret = self.buffer.read_int32()
*/

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

/* "asyncpg/protocol/coreproto.pyx":546
 *         self.backend_secret = self.buffer.read_int32()
 * 
 *     cdef _parse_msg_parameter_status(self):             # <<<<<<<<<<<<<<
 *         name = self.buffer.read_null_str()
 *         name = name.decode(self.encoding)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_msg_parameter_status", 0);

  /* "asyncpg/protocol/coreproto.pyx":547
 * 
 *     cdef _parse_msg_parameter_status(self):
 *         name = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 *         name = name.decode(self.encoding)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":548
 *     cdef _parse_msg_parameter_status(self):
 *         name = self.buffer.read_null_str()
 *         name = name.decode(self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         val = self.buffer.read_null_str()
*/
  __pyx_t_2 = __pyx_v_name;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":550
 *         name = name.decode(self.encoding)
 * 
 *         val = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 *         val = val.decode(self.encoding)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_val = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":551
 * 
 *         val = self.buffer.read_null_str()
 *         val = val.decode(self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         self._set_server_parameter(name, val)
*/
  __pyx_t_2 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":553
 *         val = val.decode(self.encoding)
 * 
 *         self._set_server_parameter(name, val)             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_notification(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_server_parameter(__pyx_v_self, __pyx_v_name, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":546
 *         self.backend_secret = self.buffer.read_int32()
 * 
 *     cdef _parse_msg_parameter_status(self):             # <<<<<<<<<<<<<<
 *         name = self.buffer.read_null_str()
 *         name = name.decode(self.encoding)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_parameter_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":555
 *         self._set_server_parameter(name, val)
 * 
 *     cdef _parse_msg_notification(self):             # <<<<<<<<<<<<<<
 *         pid = self.buffer.read_int32()
 *         channel = self.buffer.read_null_str().decode(self.encoding)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  int32_t __pyx_v_pid;
  PyObject *__pyx_v_channel = NULL;
  PyObject *__pyx_v_payload = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_msg_notification", 0);

  /* "asyncpg/protocol/coreproto.pyx":556
 * 
 *     cdef _parse_msg_notification(self):
 *         pid = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         channel = self.buffer.read_null_str().decode(self.encoding)
 *         payload = self.buffer.read_null_str().decode(self.encoding)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 556, __pyx_L1_error)
  __pyx_v_pid = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":557
 *     cdef _parse_msg_notification(self):
 *         pid = self.buffer.read_int32()
 *         channel = self.buffer.read_null_str().decode(self.encoding)             # <<<<<<<<<<<<<<
 *         payload = self.buffer.read_null_str().decode(self.encoding)
 *         self._on_notification(pid, channel, payload)
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->encoding};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_channel = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":558
 *         pid = self.buffer.read_int32()
 *         channel = self.buffer.read_null_str().decode(self.encoding)
 *         payload = self.buffer.read_null_str().decode(self.encoding)             # <<<<<<<<<<<<<<
 *         self._on_notification(pid, channel, payload)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->encoding};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_payload = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":559
 *         channel = self.buffer.read_null_str().decode(self.encoding)
 *         payload = self.buffer.read_null_str().decode(self.encoding)
 *         self._on_notification(pid, channel, payload)             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_authentication(self):
*/
  __pyx_t_2 = __Pyx_PyLong_From_int32_t(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_notification(__pyx_v_self, __pyx_t_2, __pyx_v_channel, __pyx_v_payload); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":555
 *         self._set_server_parameter(name, val)
 * 
 *     cdef _parse_msg_notification(self):             # <<<<<<<<<<<<<<
 *         pid = self.buffer.read_int32()
 *         channel = self.buffer.read_null_str().decode(self.encoding)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_notification", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_channel);
  __Pyx_XDECREF(__pyx_v_payload);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":561
 *         self._on_notification(pid, channel, payload)
 * 
 *     cdef _parse_msg_authentication(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int32_t status
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  int32_t __pyx_v_status;
  PyObject *__pyx_v_md5_salt = 0;
  PyObject *__pyx_v_sasl_auth_methods = 0;
  PyObject *__pyx_v_unsupported_sasl_auth_methods = 0;
  PyObject *__pyx_v_auth_method = NULL;
  PyObject *__pyx_v_server_response = NULL;
  PyObject *__pyx_8genexpr9__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int32_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_msg_authentication", 0);

  /* "asyncpg/protocol/coreproto.pyx":568
 *             list unsupported_sasl_auth_methods
 * 
 *         status = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 * 
 *         if status == AUTH_SUCCESSFUL:
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 568, __pyx_L1_error)
  __pyx_v_status = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":570
 *         status = self.buffer.read_int32()
 * 
 *         if status == AUTH_SUCCESSFUL:             # <<<<<<<<<<<<<<
 *             # AuthenticationOk
 *             self.result_type = RESULT_OK
*/
  switch (__pyx_v_status) {
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SUCCESSFUL:

    /* "asyncpg/protocol/coreproto.pyx":572
 *         if status == AUTH_SUCCESSFUL:
 *             # AuthenticationOk
 *             self.result_type = RESULT_OK             # <<<<<<<<<<<<<<
 * 
 *         elif status == AUTH_REQUIRED_PASSWORD:
*/
    __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK;

    /* "asyncpg/protocol/coreproto.pyx":570
 *         status = self.buffer.read_int32()
 * 
 *         if status == AUTH_SUCCESSFUL:             # <<<<<<<<<<<<<<
 *             # AuthenticationOk
 *             self.result_type = RESULT_OK
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD:

    /* "asyncpg/protocol/coreproto.pyx":576
 *         elif status == AUTH_REQUIRED_PASSWORD:
 *             # AuthenticationCleartextPassword
 *             self.result_type = RESULT_OK             # <<<<<<<<<<<<<<
 *             self.auth_msg = self._auth_password_message_cleartext()
 * 
*/
    __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK;

    /* "asyncpg/protocol/coreproto.pyx":577
 *             # AuthenticationCleartextPassword
 *             self.result_type = RESULT_OK
 *             self.auth_msg = self._auth_password_message_cleartext()             # <<<<<<<<<<<<<<
 * 
 *         elif status == AUTH_REQUIRED_PASSWORDMD5:
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_cleartext(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 577, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":574
 *             self.result_type = RESULT_OK
 * 
 *         elif status == AUTH_REQUIRED_PASSWORD:             # <<<<<<<<<<<<<<
 *             # AuthenticationCleartextPassword
 *             self.result_type = RESULT_OK
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5:

    /* "asyncpg/protocol/coreproto.pyx":582
 *             # AuthenticationMD5Password
 *             # Note: MD5 salt is passed as a four-byte sequence
 *             md5_salt = self.buffer.read_bytes(4)             # <<<<<<<<<<<<<<
 *             self.auth_msg = self._auth_password_message_md5(md5_salt)
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 4); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_md5_salt = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":583
 *             # Note: MD5 salt is passed as a four-byte sequence
 *             md5_salt = self.buffer.read_bytes(4)
 *             self.auth_msg = self._auth_password_message_md5(md5_salt)             # <<<<<<<<<<<<<<
 * 
 *         elif status == AUTH_REQUIRED_SASL:
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_md5(__pyx_v_self, __pyx_v_md5_salt); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":579
 *             self.auth_msg = self._auth_password_message_cleartext()
 * 
 *         elif status == AUTH_REQUIRED_PASSWORDMD5:             # <<<<<<<<<<<<<<
 *             # AuthenticationMD5Password
 *             # Note: MD5 salt is passed as a four-byte sequence
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL:

    /* "asyncpg/protocol/coreproto.pyx":590
 *             # to follow the SCRAM protocol defined in RFC 5802.
 *             # get the SASL authentication methods that the server is providing
 *             sasl_auth_methods = []             # <<<<<<<<<<<<<<
 *             unsupported_sasl_auth_methods = []
 *             # determine if the advertised authentication methods are supported,
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_sasl_auth_methods = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":591
 *             # get the SASL authentication methods that the server is providing
 *             sasl_auth_methods = []
 *             unsupported_sasl_auth_methods = []             # <<<<<<<<<<<<<<
 *             # determine if the advertised authentication methods are supported,
 *             # and if so, add them to the list
*/
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_unsupported_sasl_auth_methods = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":594
 *             # determine if the advertised authentication methods are supported,
 *             # and if so, add them to the list
 *             auth_method = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 *             while auth_method:
 *                 if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS:
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_auth_method = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":595
 *             # and if so, add them to the list
 *             auth_method = self.buffer.read_null_str()
 *             while auth_method:             # <<<<<<<<<<<<<<
 *                 if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS:
 *                     sasl_auth_methods.append(auth_method)
*/
    while (1) {
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_auth_method); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 595, __pyx_L1_error)
      if (!__pyx_t_3) break;

      /* "asyncpg/protocol/coreproto.pyx":596
 *             auth_method = self.buffer.read_null_str()
 *             while auth_method:
 *                 if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS:             # <<<<<<<<<<<<<<
 *                     sasl_auth_methods.append(auth_method)
 *                 else:
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication), __pyx_mstate_global->__pyx_n_u_AUTHENTICATION_METHODS); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_auth_method, __pyx_t_2, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 596, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {

        /* "asyncpg/protocol/coreproto.pyx":597
 *             while auth_method:
 *                 if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS:
 *                     sasl_auth_methods.append(auth_method)             # <<<<<<<<<<<<<<
 *                 else:
 *                     unsupported_sasl_auth_methods.append(auth_method)
*/
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_sasl_auth_methods, __pyx_v_auth_method); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(15, 597, __pyx_L1_error)

        /* "asyncpg/protocol/coreproto.pyx":596
 *             auth_method = self.buffer.read_null_str()
 *             while auth_method:
 *                 if auth_method in SCRAMAuthentication.AUTHENTICATION_METHODS:             # <<<<<<<<<<<<<<
 *                     sasl_auth_methods.append(auth_method)
 *                 else:
*/
        goto __pyx_L5;
      }

      /* "asyncpg/protocol/coreproto.pyx":599
 *                     sasl_auth_methods.append(auth_method)
 *                 else:
 *                     unsupported_sasl_auth_methods.append(auth_method)             # <<<<<<<<<<<<<<
 *                 auth_method = self.buffer.read_null_str()
 * 
*/
      /*else*/ {
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_unsupported_sasl_auth_methods, __pyx_v_auth_method); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(15, 599, __pyx_L1_error)
      }
      __pyx_L5:;

      /* "asyncpg/protocol/coreproto.pyx":600
 *                 else:
 *                     unsupported_sasl_auth_methods.append(auth_method)
 *                 auth_method = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 * 
 *             # if none of the advertised authentication methods are supported,
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 600, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_auth_method, __pyx_t_2);
      __pyx_t_2 = 0;
    }

    /* "asyncpg/protocol/coreproto.pyx":605
 *             # raise an error
 *             # otherwise, initialize the SASL authentication exchange
 *             if not sasl_auth_methods:             # <<<<<<<<<<<<<<
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")
 *                     for m in unsupported_sasl_auth_methods]
*/
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_sasl_auth_methods);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(15, 605, __pyx_L1_error)
      __pyx_t_3 = (__pyx_temp != 0);
    }

    __pyx_t_5 = (!__pyx_t_3);
    if (__pyx_t_5) {

      /* "asyncpg/protocol/coreproto.pyx":606
 *             # otherwise, initialize the SASL authentication exchange
 *             if not sasl_auth_methods:
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")             # <<<<<<<<<<<<<<
 *                     for m in unsupported_sasl_auth_methods]
 *                 self.result_type = RESULT_FAILED
*/
      { /* enter inner scope */
        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 606, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_2);

        /* "asyncpg/protocol/coreproto.pyx":607
 *             if not sasl_auth_methods:
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")
 *                     for m in unsupported_sasl_auth_methods]             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
        __pyx_t_6 = __pyx_v_unsupported_sasl_auth_methods; __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = 0;
        for (;;) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(15, 607, __pyx_L9_error)
            #endif
            if (__pyx_t_7 >= __pyx_temp) break;
          }
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_6, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_7;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 607, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_m, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "asyncpg/protocol/coreproto.pyx":606
 *             # otherwise, initialize the SASL authentication exchange
 *             if not sasl_auth_methods:
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")             # <<<<<<<<<<<<<<
 *                     for m in unsupported_sasl_auth_methods]
 *                 self.result_type = RESULT_FAILED
*/
          __pyx_t_9 = __pyx_8genexpr9__pyx_v_m;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ascii};
            __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 606, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(15, 606, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "asyncpg/protocol/coreproto.pyx":607
 *             if not sasl_auth_methods:
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")
 *                     for m in unsupported_sasl_auth_methods]             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m); __pyx_8genexpr9__pyx_v_m = 0;
        goto __pyx_L13_exit_scope;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m); __pyx_8genexpr9__pyx_v_m = 0;
        goto __pyx_L1_error;
        __pyx_L13_exit_scope:;
      } /* exit inner scope */
      __Pyx_DECREF_SET(__pyx_v_unsupported_sasl_auth_methods, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":608
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")
 *                     for m in unsupported_sasl_auth_methods]
 *                 self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                 self.result = apg_exc.InterfaceError(
 *                     'unsupported SASL Authentication methods requested by the '
*/
      __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

      /* "asyncpg/protocol/coreproto.pyx":609
 *                     for m in unsupported_sasl_auth_methods]
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                     'unsupported SASL Authentication methods requested by the '
 *                     'server: {!r}'.format(
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/coreproto.pyx":611
 *                 self.result = apg_exc.InterfaceError(
 *                     'unsupported SASL Authentication methods requested by the '
 *                     'server: {!r}'.format(             # <<<<<<<<<<<<<<
 *                         ", ".join(unsupported_sasl_auth_methods)))
 *             else:
*/
      __pyx_t_11 = __pyx_mstate_global->__pyx_kp_u_unsupported_SASL_Authentication;
      __Pyx_INCREF(__pyx_t_11);

      /* "asyncpg/protocol/coreproto.pyx":612
 *                     'unsupported SASL Authentication methods requested by the '
 *                     'server: {!r}'.format(
 *                         ", ".join(unsupported_sasl_auth_methods)))             # <<<<<<<<<<<<<<
 *             else:
 *                 self.auth_msg = self._auth_password_message_sasl_initial(
*/
      __pyx_t_12 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__17, __pyx_v_unsupported_sasl_auth_methods); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }

      /* "asyncpg/protocol/coreproto.pyx":609
 *                     for m in unsupported_sasl_auth_methods]
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                     'unsupported SASL Authentication methods requested by the '
 *                     'server: {!r}'.format(
*/
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->result);
      __Pyx_DECREF(__pyx_v_self->result);
      __pyx_v_self->result = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":605
 *             # raise an error
 *             # otherwise, initialize the SASL authentication exchange
 *             if not sasl_auth_methods:             # <<<<<<<<<<<<<<
 *                 unsupported_sasl_auth_methods = [m.decode("ascii")
 *                     for m in unsupported_sasl_auth_methods]
*/
      goto __pyx_L6;
    }

    /* "asyncpg/protocol/coreproto.pyx":614
 *                         ", ".join(unsupported_sasl_auth_methods)))
 *             else:
 *                 self.auth_msg = self._auth_password_message_sasl_initial(             # <<<<<<<<<<<<<<
 *                     sasl_auth_methods)
 * 
*/
    /*else*/ {

      /* "asyncpg/protocol/coreproto.pyx":615
 *             else:
 *                 self.auth_msg = self._auth_password_message_sasl_initial(
 *                     sasl_auth_methods)             # <<<<<<<<<<<<<<
 * 
 *         elif status == AUTH_SASL_CONTINUE:
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_sasl_initial(__pyx_v_self, __pyx_v_sasl_auth_methods); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "asyncpg/protocol/coreproto.pyx":614
 *                         ", ".join(unsupported_sasl_auth_methods)))
 *             else:
 *                 self.auth_msg = self._auth_password_message_sasl_initial(             # <<<<<<<<<<<<<<
 *                     sasl_auth_methods)
 * 
*/
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 614, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L6:;

    /* "asyncpg/protocol/coreproto.pyx":585
 *             self.auth_msg = self._auth_password_message_md5(md5_salt)
 * 
 *         elif status == AUTH_REQUIRED_SASL:             # <<<<<<<<<<<<<<
 *             # AuthenticationSASL
 *             # This requires making additional requests to the server in order
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE:

    /* "asyncpg/protocol/coreproto.pyx":623
 *             # if this is valid.
 *             # The client builds a challenge response to the server
 *             server_response = self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *             self.auth_msg = self._auth_password_message_sasl_continue(
 *                 server_response)
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_server_response = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":624
 *             # The client builds a challenge response to the server
 *             server_response = self.buffer.consume_message()
 *             self.auth_msg = self._auth_password_message_sasl_continue(             # <<<<<<<<<<<<<<
 *                 server_response)
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_password_message_sasl_continue(__pyx_v_self, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 624, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":617
 *                     sasl_auth_methods)
 * 
 *         elif status == AUTH_SASL_CONTINUE:             # <<<<<<<<<<<<<<
 *             # AUTH_SASL_CONTINUE
 *             # this requeires sending the second part of the SASL exchange, where
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL:

    /* "asyncpg/protocol/coreproto.pyx":629
 *         elif status == AUTH_SASL_FINAL:
 *             # AUTH_SASL_FINAL
 *             server_response = self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *             if not self.scram.verify_server_final_message(server_response):
 *                 self.result_type = RESULT_FAILED
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_server_response = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":630
 *             # AUTH_SASL_FINAL
 *             server_response = self.buffer.consume_message()
 *             if not self.scram.verify_server_final_message(server_response):             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message(__pyx_v_self->scram, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(15, 630, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = (!__pyx_t_5);
    if (__pyx_t_3) {

      /* "asyncpg/protocol/coreproto.pyx":631
 *             server_response = self.buffer.consume_message()
 *             if not self.scram.verify_server_final_message(server_response):
 *                 self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                 self.result = apg_exc.InterfaceError(
 *                     'could not verify server signature for '
*/
      __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

      /* "asyncpg/protocol/coreproto.pyx":632
 *             if not self.scram.verify_server_final_message(server_response):
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                     'could not verify server signature for '
 *                     'SCRAM authentciation: scram-sha-256',
*/
      __pyx_t_9 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_9);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_could_not_verify_server_signatur};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->result);
      __Pyx_DECREF(__pyx_v_self->result);
      __pyx_v_self->result = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":630
 *             # AUTH_SASL_FINAL
 *             server_response = self.buffer.consume_message()
 *             if not self.scram.verify_server_final_message(server_response):             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
    }

    /* "asyncpg/protocol/coreproto.pyx":636
 *                     'SCRAM authentciation: scram-sha-256',
 *                 )
 *             self.scram = None             # <<<<<<<<<<<<<<
 * 
 *         elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI):
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->scram);
    __Pyx_DECREF((PyObject *)__pyx_v_self->scram);
    __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None);

    /* "asyncpg/protocol/coreproto.pyx":627
 *                 server_response)
 * 
 *         elif status == AUTH_SASL_FINAL:             # <<<<<<<<<<<<<<
 *             # AUTH_SASL_FINAL
 *             server_response = self.buffer.consume_message()
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS:

    /* "asyncpg/protocol/coreproto.pyx":638
 *             self.scram = None
 * 
 *         elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI):             # <<<<<<<<<<<<<<
 *             # AUTH_REQUIRED_SSPI is the same as AUTH_REQUIRED_GSS, except that
 *             # it uses protocol negotiation with SSPI clients. Both methods use
*/
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI:

    /* "asyncpg/protocol/coreproto.pyx":642
 *             # it uses protocol negotiation with SSPI clients. Both methods use
 *             # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps.
 *             if self.gss_ctx is not None:             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
    __pyx_t_3 = (__pyx_v_self->gss_ctx != Py_None);
    if (__pyx_t_3) {

      /* "asyncpg/protocol/coreproto.pyx":643
 *             # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps.
 *             if self.gss_ctx is not None:
 *                 self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *                 self.result = apg_exc.InterfaceError(
 *                     'duplicate GSSAPI/SSPI authentication request')
*/
      __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

      /* "asyncpg/protocol/coreproto.pyx":644
 *             if self.gss_ctx is not None:
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                     'duplicate GSSAPI/SSPI authentication request')
 *             else:
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 644, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 644, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_duplicate_GSSAPI_SSPI_authentica};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->result);
      __Pyx_DECREF(__pyx_v_self->result);
      __pyx_v_self->result = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":642
 *             # it uses protocol negotiation with SSPI clients. Both methods use
 *             # AUTH_REQUIRED_GSS_CONTINUE for subsequent authentication steps.
 *             if self.gss_ctx is not None:             # <<<<<<<<<<<<<<
 *                 self.result_type = RESULT_FAILED
 *                 self.result = apg_exc.InterfaceError(
*/
      goto __pyx_L15;
    }

    /* "asyncpg/protocol/coreproto.pyx":647
 *                     'duplicate GSSAPI/SSPI authentication request')
 *             else:
 *                 if self.con_params.gsslib == 'gssapi':             # <<<<<<<<<<<<<<
 *                     self._auth_gss_init_gssapi()
 *                 else:
*/
    /*else*/ {
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_gsslib); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gssapi, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 647, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {

        /* "asyncpg/protocol/coreproto.pyx":648
 *             else:
 *                 if self.con_params.gsslib == 'gssapi':
 *                     self._auth_gss_init_gssapi()             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI)
*/
        __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_init_gssapi(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "asyncpg/protocol/coreproto.pyx":647
 *                     'duplicate GSSAPI/SSPI authentication request')
 *             else:
 *                 if self.con_params.gsslib == 'gssapi':             # <<<<<<<<<<<<<<
 *                     self._auth_gss_init_gssapi()
 *                 else:
*/
        goto __pyx_L16;
      }

      /* "asyncpg/protocol/coreproto.pyx":650
 *                     self._auth_gss_init_gssapi()
 *                 else:
 *                     self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI)             # <<<<<<<<<<<<<<
 *                 self.auth_msg = self._auth_gss_step(None)
 * 
*/
      /*else*/ {
        __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_init_sspi(__pyx_v_self, (__pyx_v_status == __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L16:;

      /* "asyncpg/protocol/coreproto.pyx":651
 *                 else:
 *                     self._auth_gss_init_sspi(status == AUTH_REQUIRED_SSPI)
 *                 self.auth_msg = self._auth_gss_step(None)             # <<<<<<<<<<<<<<
 * 
 *         elif status == AUTH_REQUIRED_GSS_CONTINUE:
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_step(__pyx_v_self, ((PyObject*)Py_None)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 651, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L15:;

    /* "asyncpg/protocol/coreproto.pyx":638
 *             self.scram = None
 * 
 *         elif status in (AUTH_REQUIRED_GSS, AUTH_REQUIRED_SSPI):             # <<<<<<<<<<<<<<
 *             # AUTH_REQUIRED_SSPI is the same as AUTH_REQUIRED_GSS, except that
 *             # it uses protocol negotiation with SSPI clients. Both methods use
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE:

    /* "asyncpg/protocol/coreproto.pyx":654
 * 
 *         elif status == AUTH_REQUIRED_GSS_CONTINUE:
 *             server_response = self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *             self.auth_msg = self._auth_gss_step(server_response)
 * 
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_server_response = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":655
 *         elif status == AUTH_REQUIRED_GSS_CONTINUE:
 *             server_response = self.buffer.consume_message()
 *             self.auth_msg = self._auth_gss_step(server_response)             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_step(__pyx_v_self, __pyx_v_server_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_auth_msg, __pyx_t_2) < (0)) __PYX_ERR(15, 655, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":653
 *                 self.auth_msg = self._auth_gss_step(None)
 * 
 *         elif status == AUTH_REQUIRED_GSS_CONTINUE:             # <<<<<<<<<<<<<<
 *             server_response = self.buffer.consume_message()
 *             self.auth_msg = self._auth_gss_step(server_response)
*/
    break;
    default:

    /* "asyncpg/protocol/coreproto.pyx":658
 * 
 *         else:
 *             self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *             self.result = apg_exc.InterfaceError(
 *                 'unsupported authentication method requested by the '
*/
    __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

    /* "asyncpg/protocol/coreproto.pyx":659
 *         else:
 *             self.result_type = RESULT_FAILED
 *             self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'unsupported authentication method requested by the '
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "asyncpg/protocol/coreproto.pyx":661
 *             self.result = apg_exc.InterfaceError(
 *                 'unsupported authentication method requested by the '
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))             # <<<<<<<<<<<<<<
 * 
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,
*/
    __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_unsupported_authentication_metho;
    __Pyx_INCREF(__pyx_t_12);
    __pyx_t_13 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_AUTH_METHOD_NAME); if (unlikely(!__pyx_t_14)) __PYX_ERR(15, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_15)) __PYX_ERR(15, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __Pyx_PyLong_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_14)) __PYX_ERR(15, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_16 = __Pyx_PyLong_From_int32_t(__pyx_v_status); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_15))) {
      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
      assert(__pyx_t_13);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_13, __pyx_t_14, __pyx_t_16};
      __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
    }
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 659, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "asyncpg/protocol/coreproto.pyx":659
 *         else:
 *             self.result_type = RESULT_FAILED
 *             self.result = apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'unsupported authentication method requested by the '
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))
*/
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->result);
    __Pyx_DECREF(__pyx_v_self->result);
    __pyx_v_self->result = __pyx_t_2;
    __pyx_t_2 = 0;
    break;
  }

  /* "asyncpg/protocol/coreproto.pyx":663
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))
 * 
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,             # <<<<<<<<<<<<<<
 *                           AUTH_REQUIRED_GSS_CONTINUE):
 *             self.buffer.discard_message()
*/
  switch (__pyx_v_status) {
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_CONTINUE:
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_SASL_FINAL:
    case __pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS_CONTINUE:

    /* "asyncpg/protocol/coreproto.pyx":664
 * 
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,
 *                           AUTH_REQUIRED_GSS_CONTINUE):             # <<<<<<<<<<<<<<
 *             self.buffer.discard_message()
 * 
*/
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":663
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))
 * 
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,             # <<<<<<<<<<<<<<
 *                           AUTH_REQUIRED_GSS_CONTINUE):
 *             self.buffer.discard_message()
*/
    break;
    default:
    __pyx_t_3 = 1;
    break;
  }
  __pyx_t_5 = __pyx_t_3;
  if (__pyx_t_5) {

    /* "asyncpg/protocol/coreproto.pyx":665
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,
 *                           AUTH_REQUIRED_GSS_CONTINUE):
 *             self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_password_message_cleartext(self):
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/coreproto.pyx":663
 *                 'server: {!r}'.format(AUTH_METHOD_NAME.get(status, status)))
 * 
 *         if status not in (AUTH_SASL_CONTINUE, AUTH_SASL_FINAL,             # <<<<<<<<<<<<<<
 *                           AUTH_REQUIRED_GSS_CONTINUE):
 *             self.buffer.discard_message()
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":561
 *         self._on_notification(pid, channel, payload)
 * 
 *     cdef _parse_msg_authentication(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int32_t status
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_authentication", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_md5_salt);
  __Pyx_XDECREF(__pyx_v_sasl_auth_methods);
  __Pyx_XDECREF(__pyx_v_unsupported_sasl_auth_methods);
  __Pyx_XDECREF(__pyx_v_auth_method);
  __Pyx_XDECREF(__pyx_v_server_response);
  __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":667
 *             self.buffer.discard_message()
 * 
 *     cdef _auth_password_message_cleartext(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_password_message_cleartext", 0);

  /* "asyncpg/protocol/coreproto.pyx":671
 *             WriteBuffer msg
 * 
 *         msg = WriteBuffer.new_message(b'p')             # <<<<<<<<<<<<<<
 *         msg.write_bytestring(self.password.encode(self.encoding))
 *         msg.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":672
 * 
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytestring(self.password.encode(self.encoding))             # <<<<<<<<<<<<<<
 *         msg.end_message()
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 672, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 672, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":673
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytestring(self.password.encode(self.encoding))
 *         msg.end_message()             # <<<<<<<<<<<<<<
 * 
 *         return msg
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":675
 *         msg.end_message()
 * 
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_password_message_md5(self, bytes salt):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
  __pyx_r = ((PyObject *)__pyx_v_msg);
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":667
 *             self.buffer.discard_message()
 * 
 *     cdef _auth_password_message_cleartext(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_cleartext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":677
 *         return msg
 * 
 *     cdef _auth_password_message_md5(self, bytes salt):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_salt) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_v_userpass = NULL;
  PyObject *__pyx_v_md5_1 = NULL;
  PyObject *__pyx_v_md5_2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_password_message_md5", 0);

  /* "asyncpg/protocol/coreproto.pyx":681
 *             WriteBuffer msg
 * 
 *         msg = WriteBuffer.new_message(b'p')             # <<<<<<<<<<<<<<
 * 
 *         # 'md5' + md5(md5(password + username) + salt))
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":684
 * 
 *         # 'md5' + md5(md5(password + username) + salt))
 *         userpass = (self.password or '') + (self.user or '')             # <<<<<<<<<<<<<<
 *         md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest()
 *         md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest()
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 684, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
  __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_L3_bool_binop_done:;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 684, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_2 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
  __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_L5_bool_binop_done:;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_userpass = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":685
 *         # 'md5' + md5(md5(password + username) + salt))
 *         userpass = (self.password or '') + (self.user or '')
 *         md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest()             # <<<<<<<<<<<<<<
 *         md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest()
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_md5); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __pyx_v_userpass;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self->encoding};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hexdigest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_md5_1 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":686
 *         userpass = (self.password or '') + (self.user or '')
 *         md5_1 = hashlib.md5(userpass.encode(self.encoding)).hexdigest()
 *         md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest()             # <<<<<<<<<<<<<<
 * 
 *         msg.write_bytestring(b'md5' + md5_2.encode('ascii'))
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_md5); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __pyx_v_md5_1;
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ascii};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(15, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_v_salt); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hexdigest, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_md5_2 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":688
 *         md5_2 = hashlib.md5(md5_1.encode('ascii') + salt).hexdigest()
 * 
 *         msg.write_bytestring(b'md5' + md5_2.encode('ascii'))             # <<<<<<<<<<<<<<
 *         msg.end_message()
 * 
*/
  __pyx_t_2 = __pyx_v_md5_2;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ascii};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_2 = PyNumber_Add(__pyx_mstate_global->__pyx_n_b_md5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 688, __pyx_L1_error)
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytestring(__pyx_v_msg, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":689
 * 
 *         msg.write_bytestring(b'md5' + md5_2.encode('ascii'))
 *         msg.end_message()             # <<<<<<<<<<<<<<
 * 
 *         return msg
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":691
 *         msg.end_message()
 * 
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
  __pyx_r = ((PyObject *)__pyx_v_msg);
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":677
 *         return msg
 * 
 *     cdef _auth_password_message_md5(self, bytes salt):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_md5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_userpass);
  __Pyx_XDECREF(__pyx_v_md5_1);
  __Pyx_XDECREF(__pyx_v_md5_2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":693
 *         return msg
 * 
 *     cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_sasl_auth_methods) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_password_message_sasl_initial", 0);

  /* "asyncpg/protocol/coreproto.pyx":698
 * 
 *         # use the first supported advertized mechanism
 *         self.scram = SCRAMAuthentication(sasl_auth_methods[0])             # <<<<<<<<<<<<<<
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')
*/
  __pyx_t_2 = NULL;
  if (unlikely(__pyx_v_sasl_auth_methods == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(15, 698, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_sasl_auth_methods, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 698, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->scram);
  __Pyx_DECREF((PyObject *)__pyx_v_self->scram);
  __pyx_v_self->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":700
 *         self.scram = SCRAMAuthentication(sasl_auth_methods[0])
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')             # <<<<<<<<<<<<<<
 *         msg.write_bytes(self.scram.create_client_first_message(self.user or ''))
 *         msg.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":701
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytes(self.scram.create_client_first_message(self.user or ''))             # <<<<<<<<<<<<<<
 *         msg.end_message()
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(15, 701, __pyx_L1_error)
  if (!__pyx_t_5) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(15, 701, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
  __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_L3_bool_binop_done:;
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message(__pyx_v_self->scram, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(15, 701, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":702
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytes(self.scram.create_client_first_message(self.user or ''))
 *         msg.end_message()             # <<<<<<<<<<<<<<
 * 
 *         return msg
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":704
 *         msg.end_message()
 * 
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_password_message_sasl_continue(self, bytes server_response):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
  __pyx_r = ((PyObject *)__pyx_v_msg);
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":693
 *         return msg
 * 
 *     cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_sasl_initial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":706
 *         return msg
 * 
 *     cdef _auth_password_message_sasl_continue(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_v_client_final_message = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_password_message_sasl_continue", 0);

  /* "asyncpg/protocol/coreproto.pyx":711
 * 
 *         # determine if there is a valid server response
 *         self.scram.parse_server_first_message(server_response)             # <<<<<<<<<<<<<<
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message(__pyx_v_self->scram, __pyx_v_server_response); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":713
 *         self.scram.parse_server_first_message(server_response)
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')             # <<<<<<<<<<<<<<
 *         client_final_message = self.scram.create_client_final_message(
 *             self.password or '')
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":715
 *         msg = WriteBuffer.new_message(b'p')
 *         client_final_message = self.scram.create_client_final_message(
 *             self.password or '')             # <<<<<<<<<<<<<<
 *         msg.write_bytes(client_final_message)
 *         msg.end_message()
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_password); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 715, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_4 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_4);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(15, 715, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
  __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u__15;
  __pyx_L3_bool_binop_done:;

  /* "asyncpg/protocol/coreproto.pyx":714
 *         # this involves a call and response with the server
 *         msg = WriteBuffer.new_message(b'p')
 *         client_final_message = self.scram.create_client_final_message(             # <<<<<<<<<<<<<<
 *             self.password or '')
 *         msg.write_bytes(client_final_message)
*/
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message(__pyx_v_self->scram, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_client_final_message = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":716
 *         client_final_message = self.scram.create_client_final_message(
 *             self.password or '')
 *         msg.write_bytes(client_final_message)             # <<<<<<<<<<<<<<
 *         msg.end_message()
 * 
*/
  __pyx_t_2 = __pyx_v_client_final_message;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 716, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":717
 *             self.password or '')
 *         msg.write_bytes(client_final_message)
 *         msg.end_message()             # <<<<<<<<<<<<<<
 * 
 *         return msg
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":719
 *         msg.end_message()
 * 
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_gss_init_gssapi(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
  __pyx_r = ((PyObject *)__pyx_v_msg);
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":706
 *         return msg
 * 
 *     cdef _auth_password_message_sasl_continue(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_password_message_sasl_continue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_client_final_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":721
 *         return msg
 * 
 *     cdef _auth_gss_init_gssapi(self):             # <<<<<<<<<<<<<<
 *         try:
 *             import gssapi
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_v_gssapi = NULL;
  PyObject *__pyx_v_service_name = NULL;
  PyObject *__pyx_v_host = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_gss_init_gssapi", 0);

  /* "asyncpg/protocol/coreproto.pyx":722
 * 
 *     cdef _auth_gss_init_gssapi(self):
 *         try:             # <<<<<<<<<<<<<<
 *             import gssapi
 *         except ModuleNotFoundError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/coreproto.pyx":723
 *     cdef _auth_gss_init_gssapi(self):
 *         try:
 *             import gssapi             # <<<<<<<<<<<<<<
 *         except ModuleNotFoundError:
 *             raise apg_exc.InterfaceError(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gssapi, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 723, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_gssapi = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/coreproto.pyx":722
 * 
 *     cdef _auth_gss_init_gssapi(self):
 *         try:             # <<<<<<<<<<<<<<
 *             import gssapi
 *         except ModuleNotFoundError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/coreproto.pyx":724
 *         try:
 *             import gssapi
 *         except ModuleNotFoundError:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'gssapi module not found; please install asyncpg[gssauth] to '
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ModuleNotFoundError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_gssapi", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(15, 724, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "asyncpg/protocol/coreproto.pyx":725
 *             import gssapi
 *         except ModuleNotFoundError:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'gssapi module not found; please install asyncpg[gssauth] to '
 *                 'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 725, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 725, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
        __pyx_t_13 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_gssapi_module_not_found_please_i};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 725, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }

      /* "asyncpg/protocol/coreproto.pyx":728
 *                 'gssapi module not found; please install asyncpg[gssauth] to '
 *                 'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
 *             ) from None             # <<<<<<<<<<<<<<
 * 
 *         service_name, host = self._auth_gss_get_service()
*/
      __Pyx_Raise(__pyx_t_9, 0, 0, Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(15, 725, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/coreproto.pyx":722
 * 
 *     cdef _auth_gss_init_gssapi(self):
 *         try:             # <<<<<<<<<<<<<<
 *             import gssapi
 *         except ModuleNotFoundError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/coreproto.pyx":730
 *             ) from None
 * 
 *         service_name, host = self._auth_gss_get_service()             # <<<<<<<<<<<<<<
 *         self.gss_ctx = gssapi.SecurityContext(
 *             name=gssapi.Name(
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(15, 730, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 730, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 730, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(15, 730, __pyx_L1_error)
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(15, 730, __pyx_L1_error)
    __pyx_L12_unpacking_done:;
  }
  __pyx_v_service_name = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_host = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":731
 * 
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = gssapi.SecurityContext(             # <<<<<<<<<<<<<<
 *             name=gssapi.Name(
 *                 f'{service_name}@{host}', gssapi.NameType.hostbased_service),
*/
  __pyx_t_4 = __pyx_v_gssapi;
  __Pyx_INCREF(__pyx_t_4);

  /* "asyncpg/protocol/coreproto.pyx":732
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = gssapi.SecurityContext(
 *             name=gssapi.Name(             # <<<<<<<<<<<<<<
 *                 f'{service_name}@{host}', gssapi.NameType.hostbased_service),
 *             usage='initiate')
*/
  __pyx_t_9 = __pyx_v_gssapi;
  __Pyx_INCREF(__pyx_t_9);

  /* "asyncpg/protocol/coreproto.pyx":733
 *         self.gss_ctx = gssapi.SecurityContext(
 *             name=gssapi.Name(
 *                 f'{service_name}@{host}', gssapi.NameType.hostbased_service),             # <<<<<<<<<<<<<<
 *             usage='initiate')
 * 
*/
  __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_15[0] = __pyx_t_12;
  __pyx_t_15[1] = __pyx_mstate_global->__pyx_kp_u__18;
  __pyx_t_15[2] = __pyx_t_10;
  __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
  if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_gssapi, __pyx_mstate_global->__pyx_n_u_NameType); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_hostbased_service); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
    __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_Name, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_name, __pyx_t_7, __pyx_t_12, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 731, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_usage, __pyx_mstate_global->__pyx_n_u_initiate, __pyx_t_12, __pyx_callargs+1, 1) < (0)) __PYX_ERR(15, 731, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_SecurityContext, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }

  /* "asyncpg/protocol/coreproto.pyx":731
 * 
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = gssapi.SecurityContext(             # <<<<<<<<<<<<<<
 *             name=gssapi.Name(
 *                 f'{service_name}@{host}', gssapi.NameType.hostbased_service),
*/
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_GOTREF(__pyx_v_self->gss_ctx);
  __Pyx_DECREF(__pyx_v_self->gss_ctx);
  __pyx_v_self->gss_ctx = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "asyncpg/protocol/coreproto.pyx":721
 *         return msg
 * 
 *     cdef _auth_gss_init_gssapi(self):             # <<<<<<<<<<<<<<
 *         try:
 *             import gssapi
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_gssapi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_gssapi);
  __Pyx_XDECREF(__pyx_v_service_name);
  __Pyx_XDECREF(__pyx_v_host);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":736
 *             usage='initiate')
 * 
 *     cdef _auth_gss_init_sspi(self, bint negotiate):             # <<<<<<<<<<<<<<
 *         try:
 *             import sspilib
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, int __pyx_v_negotiate) {
  PyObject *__pyx_v_sspilib = NULL;
  PyObject *__pyx_v_service_name = NULL;
  PyObject *__pyx_v_host = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_gss_init_sspi", 0);

  /* "asyncpg/protocol/coreproto.pyx":737
 * 
 *     cdef _auth_gss_init_sspi(self, bint negotiate):
 *         try:             # <<<<<<<<<<<<<<
 *             import sspilib
 *         except ModuleNotFoundError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "asyncpg/protocol/coreproto.pyx":738
 *     cdef _auth_gss_init_sspi(self, bint negotiate):
 *         try:
 *             import sspilib             # <<<<<<<<<<<<<<
 *         except ModuleNotFoundError:
 *             raise apg_exc.InterfaceError(
*/
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sspilib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 738, __pyx_L3_error)
      __pyx_t_4 = __pyx_t_5;
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_sspilib = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/coreproto.pyx":737
 * 
 *     cdef _auth_gss_init_sspi(self, bint negotiate):
 *         try:             # <<<<<<<<<<<<<<
 *             import sspilib
 *         except ModuleNotFoundError:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "asyncpg/protocol/coreproto.pyx":739
 *         try:
 *             import sspilib
 *         except ModuleNotFoundError:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'sspilib module not found; please install asyncpg[gssauth] to '
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ModuleNotFoundError))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_sspi", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(15, 739, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);

      /* "asyncpg/protocol/coreproto.pyx":740
 *             import sspilib
 *         except ModuleNotFoundError:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'sspilib module not found; please install asyncpg[gssauth] to '
 *                 'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 740, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 740, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_13 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
        __pyx_t_13 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_sspilib_module_not_found_please};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 740, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_9);
      }

      /* "asyncpg/protocol/coreproto.pyx":743
 *                 'sspilib module not found; please install asyncpg[gssauth] to '
 *                 'use asyncpg with Kerberos/GSSAPI/SSPI authentication'
 *             ) from None             # <<<<<<<<<<<<<<
 * 
 *         service_name, host = self._auth_gss_get_service()
*/
      __Pyx_Raise(__pyx_t_9, 0, 0, Py_None);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(15, 740, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/coreproto.pyx":737
 * 
 *     cdef _auth_gss_init_sspi(self, bint negotiate):
 *         try:             # <<<<<<<<<<<<<<
 *             import sspilib
 *         except ModuleNotFoundError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/coreproto.pyx":745
 *             ) from None
 * 
 *         service_name, host = self._auth_gss_get_service()             # <<<<<<<<<<<<<<
 *         self.gss_ctx = sspilib.ClientSecurityContext(
 *             target_name=f'{service_name}/{host}',
*/
  __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_auth_gss_get_service(__pyx_v_self); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
    PyObject* sequence = __pyx_t_8;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(15, 745, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 745, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 745, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
    index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(15, 745, __pyx_L1_error)
    __pyx_t_14 = NULL;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_14 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(15, 745, __pyx_L1_error)
    __pyx_L12_unpacking_done:;
  }
  __pyx_v_service_name = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_v_host = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":746
 * 
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = sspilib.ClientSecurityContext(             # <<<<<<<<<<<<<<
 *             target_name=f'{service_name}/{host}',
 *             credential=sspilib.UserCredential(
*/
  __pyx_t_4 = __pyx_v_sspilib;
  __Pyx_INCREF(__pyx_t_4);

  /* "asyncpg/protocol/coreproto.pyx":747
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = sspilib.ClientSecurityContext(
 *             target_name=f'{service_name}/{host}',             # <<<<<<<<<<<<<<
 *             credential=sspilib.UserCredential(
 *                 protocol='Negotiate' if negotiate else 'Kerberos'))
*/
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_service_name, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(15, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_host, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_15[0] = __pyx_t_7;
  __pyx_t_15[1] = __pyx_mstate_global->__pyx_kp_u__19;
  __pyx_t_15[2] = __pyx_t_9;
  __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_15, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
  if (unlikely(!__pyx_t_12)) __PYX_ERR(15, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "asyncpg/protocol/coreproto.pyx":748
 *         self.gss_ctx = sspilib.ClientSecurityContext(
 *             target_name=f'{service_name}/{host}',
 *             credential=sspilib.UserCredential(             # <<<<<<<<<<<<<<
 *                 protocol='Negotiate' if negotiate else 'Kerberos'))
 * 
*/
  __pyx_t_7 = __pyx_v_sspilib;
  __Pyx_INCREF(__pyx_t_7);

  /* "asyncpg/protocol/coreproto.pyx":749
 *             target_name=f'{service_name}/{host}',
 *             credential=sspilib.UserCredential(
 *                 protocol='Negotiate' if negotiate else 'Kerberos'))             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_gss_get_service(self):
*/
  if (__pyx_v_negotiate) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Negotiate);
    __pyx_t_10 = __pyx_mstate_global->__pyx_n_u_Negotiate;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Kerberos);
    __pyx_t_10 = __pyx_mstate_global->__pyx_n_u_Kerberos;
  }
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_7, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_protocol, __pyx_t_10, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 748, __pyx_L1_error)
    __pyx_t_9 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_UserCredential, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_13 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_4, NULL};
    __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_target_name, __pyx_t_12, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(15, 746, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_credential, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(15, 746, __pyx_L1_error)
    __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_ClientSecurityContext, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }

  /* "asyncpg/protocol/coreproto.pyx":746
 * 
 *         service_name, host = self._auth_gss_get_service()
 *         self.gss_ctx = sspilib.ClientSecurityContext(             # <<<<<<<<<<<<<<
 *             target_name=f'{service_name}/{host}',
 *             credential=sspilib.UserCredential(
*/
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_GOTREF(__pyx_v_self->gss_ctx);
  __Pyx_DECREF(__pyx_v_self->gss_ctx);
  __pyx_v_self->gss_ctx = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "asyncpg/protocol/coreproto.pyx":736
 *             usage='initiate')
 * 
 *     cdef _auth_gss_init_sspi(self, bint negotiate):             # <<<<<<<<<<<<<<
 *         try:
 *             import sspilib
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_init_sspi", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sspilib);
  __Pyx_XDECREF(__pyx_v_service_name);
  __Pyx_XDECREF(__pyx_v_host);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":751
 *                 protocol='Negotiate' if negotiate else 'Kerberos'))
 * 
 *     cdef _auth_gss_get_service(self):             # <<<<<<<<<<<<<<
 *         service_name = self.con_params.krbsrvname or 'postgres'
 *         if isinstance(self.address, str):
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_v_service_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_gss_get_service", 0);

  /* "asyncpg/protocol/coreproto.pyx":752
 * 
 *     cdef _auth_gss_get_service(self):
 *         service_name = self.con_params.krbsrvname or 'postgres'             # <<<<<<<<<<<<<<
 *         if isinstance(self.address, str):
 *             raise apg_exc.InternalClientError(
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_krbsrvname); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 752, __pyx_L1_error)
  if (!__pyx_t_3) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_postgres);
  __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_postgres;
  __pyx_L3_bool_binop_done:;
  __pyx_v_service_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":753
 *     cdef _auth_gss_get_service(self):
 *         service_name = self.con_params.krbsrvname or 'postgres'
 *         if isinstance(self.address, str):             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError(
 *                 'GSSAPI/SSPI authentication is only supported for TCP/IP '
*/
  __pyx_t_1 = __pyx_v_self->address;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = PyUnicode_Check(__pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/coreproto.pyx":754
 *         service_name = self.con_params.krbsrvname or 'postgres'
 *         if isinstance(self.address, str):
 *             raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                 'GSSAPI/SSPI authentication is only supported for TCP/IP '
 *                 'connections')
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_GSSAPI_SSPI_authentication_is_on};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(15, 754, __pyx_L1_error)

    /* "asyncpg/protocol/coreproto.pyx":753
 *     cdef _auth_gss_get_service(self):
 *         service_name = self.con_params.krbsrvname or 'postgres'
 *         if isinstance(self.address, str):             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError(
 *                 'GSSAPI/SSPI authentication is only supported for TCP/IP '
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":758
 *                 'connections')
 * 
 *         return service_name, self.address[0]             # <<<<<<<<<<<<<<
 * 
 *     cdef _auth_gss_step(self, bytes server_response):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->address, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_service_name);
  __Pyx_GIVEREF(__pyx_v_service_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_service_name) != (0)) __PYX_ERR(15, 758, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(15, 758, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":751
 *                 protocol='Negotiate' if negotiate else 'Kerberos'))
 * 
 *     cdef _auth_gss_get_service(self):             # <<<<<<<<<<<<<<
 *         service_name = self.con_params.krbsrvname or 'postgres'
 *         if isinstance(self.address, str):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_get_service", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_service_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":760
 *         return service_name, self.address[0]
 * 
 *     cdef _auth_gss_step(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_server_response) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_v_token = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_gss_step", 0);

  /* "asyncpg/protocol/coreproto.pyx":764
 *             WriteBuffer msg
 * 
 *         token = self.gss_ctx.step(server_response)             # <<<<<<<<<<<<<<
 *         if not token:
 *             self.gss_ctx = None
*/
  __pyx_t_2 = __pyx_v_self->gss_ctx;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_server_response};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_step, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_token = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":765
 * 
 *         token = self.gss_ctx.step(server_response)
 *         if not token:             # <<<<<<<<<<<<<<
 *             self.gss_ctx = None
 *             return None
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_token); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(15, 765, __pyx_L1_error)
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "asyncpg/protocol/coreproto.pyx":766
 *         token = self.gss_ctx.step(server_response)
 *         if not token:
 *             self.gss_ctx = None             # <<<<<<<<<<<<<<
 *             return None
 *         msg = WriteBuffer.new_message(b'p')
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->gss_ctx);
    __Pyx_DECREF(__pyx_v_self->gss_ctx);
    __pyx_v_self->gss_ctx = Py_None;

    /* "asyncpg/protocol/coreproto.pyx":767
 *         if not token:
 *             self.gss_ctx = None
 *             return None             # <<<<<<<<<<<<<<
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytes(token)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/coreproto.pyx":765
 * 
 *         token = self.gss_ctx.step(server_response)
 *         if not token:             # <<<<<<<<<<<<<<
 *             self.gss_ctx = None
 *             return None
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":768
 *             self.gss_ctx = None
 *             return None
 *         msg = WriteBuffer.new_message(b'p')             # <<<<<<<<<<<<<<
 *         msg.write_bytes(token)
 *         msg.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":769
 *             return None
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytes(token)             # <<<<<<<<<<<<<<
 *         msg.end_message()
 * 
*/
  __pyx_t_1 = __pyx_v_token;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 769, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->write_bytes(__pyx_v_msg, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":770
 *         msg = WriteBuffer.new_message(b'p')
 *         msg.write_bytes(token)
 *         msg.end_message()             # <<<<<<<<<<<<<<
 * 
 *         return msg
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_msg->__pyx_vtab)->end_message(__pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":772
 *         msg.end_message()
 * 
 *         return msg             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_ready_for_query(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
  __pyx_r = ((PyObject *)__pyx_v_msg);
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":760
 *         return service_name, self.address[0]
 * 
 *     cdef _auth_gss_step(self, bytes server_response):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._auth_gss_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_token);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":774
 *         return msg
 * 
 *     cdef _parse_msg_ready_for_query(self):             # <<<<<<<<<<<<<<
 *         cdef char status = self.buffer.read_byte()
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  char __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse_msg_ready_for_query", 0);

  /* "asyncpg/protocol/coreproto.pyx":775
 * 
 *     cdef _parse_msg_ready_for_query(self):
 *         cdef char status = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 * 
 *         if status == b'I':
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(15, 775, __pyx_L1_error)
  __pyx_v_status = __pyx_t_1;

  /* "asyncpg/protocol/coreproto.pyx":777
 *         cdef char status = self.buffer.read_byte()
 * 
 *         if status == b'I':             # <<<<<<<<<<<<<<
 *             self.xact_status = PQTRANS_IDLE
 *         elif status == b'T':
*/
  switch (__pyx_v_status) {
    case 'I':

    /* "asyncpg/protocol/coreproto.pyx":778
 * 
 *         if status == b'I':
 *             self.xact_status = PQTRANS_IDLE             # <<<<<<<<<<<<<<
 *         elif status == b'T':
 *             self.xact_status = PQTRANS_INTRANS
*/
    __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_IDLE;

    /* "asyncpg/protocol/coreproto.pyx":777
 *         cdef char status = self.buffer.read_byte()
 * 
 *         if status == b'I':             # <<<<<<<<<<<<<<
 *             self.xact_status = PQTRANS_IDLE
 *         elif status == b'T':
*/
    break;
    case 'T':

    /* "asyncpg/protocol/coreproto.pyx":780
 *             self.xact_status = PQTRANS_IDLE
 *         elif status == b'T':
 *             self.xact_status = PQTRANS_INTRANS             # <<<<<<<<<<<<<<
 *         elif status == b'E':
 *             self.xact_status = PQTRANS_INERROR
*/
    __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INTRANS;

    /* "asyncpg/protocol/coreproto.pyx":779
 *         if status == b'I':
 *             self.xact_status = PQTRANS_IDLE
 *         elif status == b'T':             # <<<<<<<<<<<<<<
 *             self.xact_status = PQTRANS_INTRANS
 *         elif status == b'E':
*/
    break;
    case 'E':

    /* "asyncpg/protocol/coreproto.pyx":782
 *             self.xact_status = PQTRANS_INTRANS
 *         elif status == b'E':
 *             self.xact_status = PQTRANS_INERROR             # <<<<<<<<<<<<<<
 *         else:
 *             self.xact_status = PQTRANS_UNKNOWN
*/
    __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_INERROR;

    /* "asyncpg/protocol/coreproto.pyx":781
 *         elif status == b'T':
 *             self.xact_status = PQTRANS_INTRANS
 *         elif status == b'E':             # <<<<<<<<<<<<<<
 *             self.xact_status = PQTRANS_INERROR
 *         else:
*/
    break;
    default:

    /* "asyncpg/protocol/coreproto.pyx":784
 *             self.xact_status = PQTRANS_INERROR
 *         else:
 *             self.xact_status = PQTRANS_UNKNOWN             # <<<<<<<<<<<<<<
 * 
 *     cdef _parse_msg_error_response(self, is_error):
*/
    __pyx_v_self->xact_status = __pyx_e_7asyncpg_8protocol_8protocol_PQTRANS_UNKNOWN;
    break;
  }

  /* "asyncpg/protocol/coreproto.pyx":774
 *         return msg
 * 
 *     cdef _parse_msg_ready_for_query(self):             # <<<<<<<<<<<<<<
 *         cdef char status = self.buffer.read_byte()
 * 
*/

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

/* "asyncpg/protocol/coreproto.pyx":786
 *             self.xact_status = PQTRANS_UNKNOWN
 * 
 *     cdef _parse_msg_error_response(self, is_error):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char code
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_is_error) {
  char __pyx_v_code;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_parsed = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char __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;
  __Pyx_RefNannySetupContext("_parse_msg_error_response", 0);

  /* "asyncpg/protocol/coreproto.pyx":790
 *             char code
 *             bytes message
 *             dict parsed = {}             # <<<<<<<<<<<<<<
 * 
 *         while True:
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_parsed = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":792
 *             dict parsed = {}
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             code = self.buffer.read_byte()
 *             if code == 0:
*/
  while (1) {

    /* "asyncpg/protocol/coreproto.pyx":793
 * 
 *         while True:
 *             code = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 *             if code == 0:
 *                 break
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(15, 793, __pyx_L1_error)
    __pyx_v_code = __pyx_t_2;

    /* "asyncpg/protocol/coreproto.pyx":794
 *         while True:
 *             code = self.buffer.read_byte()
 *             if code == 0:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
    __pyx_t_3 = (__pyx_v_code == 0);
    if (__pyx_t_3) {

      /* "asyncpg/protocol/coreproto.pyx":795
 *             code = self.buffer.read_byte()
 *             if code == 0:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             message = self.buffer.read_null_str()
*/
      goto __pyx_L4_break;

      /* "asyncpg/protocol/coreproto.pyx":794
 *         while True:
 *             code = self.buffer.read_byte()
 *             if code == 0:             # <<<<<<<<<<<<<<
 *                 break
 * 
*/
    }

    /* "asyncpg/protocol/coreproto.pyx":797
 *                 break
 * 
 *             message = self.buffer.read_null_str()             # <<<<<<<<<<<<<<
 * 
 *             parsed[chr(code)] = message.decode()
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_null_str(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 797, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_message, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":799
 *             message = self.buffer.read_null_str()
 * 
 *             parsed[chr(code)] = message.decode()             # <<<<<<<<<<<<<<
 * 
 *         if is_error:
*/
    if (unlikely(__pyx_v_message == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
      __PYX_ERR(15, 799, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_message, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyUnicode_FromOrdinal(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely((PyDict_SetItem(__pyx_v_parsed, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(15, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4_break:;

  /* "asyncpg/protocol/coreproto.pyx":801
 *             parsed[chr(code)] = message.decode()
 * 
 *         if is_error:             # <<<<<<<<<<<<<<
 *             self.result_type = RESULT_FAILED
 *             self.result = parsed
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_error); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(15, 801, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "asyncpg/protocol/coreproto.pyx":802
 * 
 *         if is_error:
 *             self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *             self.result = parsed
 *         else:
*/
    __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

    /* "asyncpg/protocol/coreproto.pyx":803
 *         if is_error:
 *             self.result_type = RESULT_FAILED
 *             self.result = parsed             # <<<<<<<<<<<<<<
 *         else:
 *             return parsed
*/
    __Pyx_INCREF(__pyx_v_parsed);
    __Pyx_GIVEREF(__pyx_v_parsed);
    __Pyx_GOTREF(__pyx_v_self->result);
    __Pyx_DECREF(__pyx_v_self->result);
    __pyx_v_self->result = __pyx_v_parsed;

    /* "asyncpg/protocol/coreproto.pyx":801
 *             parsed[chr(code)] = message.decode()
 * 
 *         if is_error:             # <<<<<<<<<<<<<<
 *             self.result_type = RESULT_FAILED
 *             self.result = parsed
*/
    goto __pyx_L6;
  }

  /* "asyncpg/protocol/coreproto.pyx":805
 *             self.result = parsed
 *         else:
 *             return parsed             # <<<<<<<<<<<<<<
 * 
 *     cdef _push_result(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_parsed);
    __pyx_r = __pyx_v_parsed;
    goto __pyx_L0;
  }
  __pyx_L6:;

  /* "asyncpg/protocol/coreproto.pyx":786
 *             self.xact_status = PQTRANS_UNKNOWN
 * 
 *     cdef _parse_msg_error_response(self, is_error):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char code
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._parse_msg_error_response", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_parsed);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":807
 *             return parsed
 * 
 *     cdef _push_result(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self._on_result()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  char const *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_push_result", 0);

  /* "asyncpg/protocol/coreproto.pyx":808
 * 
 *     cdef _push_result(self):
 *         try:             # <<<<<<<<<<<<<<
 *             self._on_result()
 *         finally:
*/
  /*try:*/ {

    /* "asyncpg/protocol/coreproto.pyx":809
 *     cdef _push_result(self):
 *         try:
 *             self._on_result()             # <<<<<<<<<<<<<<
 *         finally:
 *             self._set_state(PROTOCOL_IDLE)
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_on_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 809, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "asyncpg/protocol/coreproto.pyx":811
 *             self._on_result()
 *         finally:
 *             self._set_state(PROTOCOL_IDLE)             # <<<<<<<<<<<<<<
 *             self._reset_result()
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "asyncpg/protocol/coreproto.pyx":812
 *         finally:
 *             self._set_state(PROTOCOL_IDLE)
 *             self._reset_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _reset_result(self):
*/
      __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 812, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename;
      {

        /* "asyncpg/protocol/coreproto.pyx":811
 *             self._on_result()
 *         finally:
 *             self._set_state(PROTOCOL_IDLE)             # <<<<<<<<<<<<<<
 *             self._reset_result()
 * 
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 811, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/coreproto.pyx":812
 *         finally:
 *             self._set_state(PROTOCOL_IDLE)
 *             self._reset_result()             # <<<<<<<<<<<<<<
 * 
 *     cdef _reset_result(self):
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_reset_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 812, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "asyncpg/protocol/coreproto.pyx":807
 *             return parsed
 * 
 *     cdef _push_result(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self._on_result()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._push_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":814
 *             self._reset_result()
 * 
 *     cdef _reset_result(self):             # <<<<<<<<<<<<<<
 *         self.result_type = RESULT_OK
 *         self.result = None
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_reset_result", 0);

  /* "asyncpg/protocol/coreproto.pyx":815
 * 
 *     cdef _reset_result(self):
 *         self.result_type = RESULT_OK             # <<<<<<<<<<<<<<
 *         self.result = None
 *         self.result_param_desc = None
*/
  __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_OK;

  /* "asyncpg/protocol/coreproto.pyx":816
 *     cdef _reset_result(self):
 *         self.result_type = RESULT_OK
 *         self.result = None             # <<<<<<<<<<<<<<
 *         self.result_param_desc = None
 *         self.result_row_desc = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = Py_None;

  /* "asyncpg/protocol/coreproto.pyx":817
 *         self.result_type = RESULT_OK
 *         self.result = None
 *         self.result_param_desc = None             # <<<<<<<<<<<<<<
 *         self.result_row_desc = None
 *         self.result_status_msg = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->result_param_desc);
  __Pyx_DECREF(__pyx_v_self->result_param_desc);
  __pyx_v_self->result_param_desc = ((PyObject*)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":818
 *         self.result = None
 *         self.result_param_desc = None
 *         self.result_row_desc = None             # <<<<<<<<<<<<<<
 *         self.result_status_msg = None
 *         self.result_execute_completed = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->result_row_desc);
  __Pyx_DECREF(__pyx_v_self->result_row_desc);
  __pyx_v_self->result_row_desc = ((PyObject*)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":819
 *         self.result_param_desc = None
 *         self.result_row_desc = None
 *         self.result_status_msg = None             # <<<<<<<<<<<<<<
 *         self.result_execute_completed = False
 *         self._discard_data = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->result_status_msg);
  __Pyx_DECREF(__pyx_v_self->result_status_msg);
  __pyx_v_self->result_status_msg = ((PyObject*)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":820
 *         self.result_row_desc = None
 *         self.result_status_msg = None
 *         self.result_execute_completed = False             # <<<<<<<<<<<<<<
 *         self._discard_data = False
 * 
*/
  __pyx_v_self->result_execute_completed = 0;

  /* "asyncpg/protocol/coreproto.pyx":821
 *         self.result_status_msg = None
 *         self.result_execute_completed = False
 *         self._discard_data = False             # <<<<<<<<<<<<<<
 * 
 *         # executemany support data
*/
  __pyx_v_self->_discard_data = 0;

  /* "asyncpg/protocol/coreproto.pyx":824
 * 
 *         # executemany support data
 *         self._execute_iter = None             # <<<<<<<<<<<<<<
 *         self._execute_portal_name = None
 *         self._execute_stmt_name = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_execute_iter);
  __Pyx_DECREF(__pyx_v_self->_execute_iter);
  __pyx_v_self->_execute_iter = Py_None;

  /* "asyncpg/protocol/coreproto.pyx":825
 *         # executemany support data
 *         self._execute_iter = None
 *         self._execute_portal_name = None             # <<<<<<<<<<<<<<
 *         self._execute_stmt_name = None
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_execute_portal_name);
  __Pyx_DECREF(__pyx_v_self->_execute_portal_name);
  __pyx_v_self->_execute_portal_name = ((PyObject*)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":826
 *         self._execute_iter = None
 *         self._execute_portal_name = None
 *         self._execute_stmt_name = None             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_state(self, ProtocolState new_state):
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_execute_stmt_name);
  __Pyx_DECREF(__pyx_v_self->_execute_stmt_name);
  __pyx_v_self->_execute_stmt_name = ((PyObject*)Py_None);

  /* "asyncpg/protocol/coreproto.pyx":814
 *             self._reset_result()
 * 
 *     cdef _reset_result(self):             # <<<<<<<<<<<<<<
 *         self.result_type = RESULT_OK
 *         self.result = None
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":828
 *         self._execute_stmt_name = None
 * 
 *     cdef _set_state(self, ProtocolState new_state):             # <<<<<<<<<<<<<<
 *         if new_state == PROTOCOL_IDLE:
 *             if self.state == PROTOCOL_FAILED:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_v_new_state) {
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_state", 0);

  /* "asyncpg/protocol/coreproto.pyx":829
 * 
 *     cdef _set_state(self, ProtocolState new_state):
 *         if new_state == PROTOCOL_IDLE:             # <<<<<<<<<<<<<<
 *             if self.state == PROTOCOL_FAILED:
 *                 raise apg_exc.InternalClientError(
*/
  switch (__pyx_v_new_state) {
    case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE:

    /* "asyncpg/protocol/coreproto.pyx":830
 *     cdef _set_state(self, ProtocolState new_state):
 *         if new_state == PROTOCOL_IDLE:
 *             if self.state == PROTOCOL_FAILED:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to "idle" state; '
*/
    switch (__pyx_v_self->state) {
      case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED:

      /* "asyncpg/protocol/coreproto.pyx":831
 *         if new_state == PROTOCOL_IDLE:
 *             if self.state == PROTOCOL_FAILED:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'cannot switch to "idle" state; '
 *                     'protocol is in the "failed" state')
*/
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_idle_state_prot};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 831, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(15, 831, __pyx_L1_error)

      /* "asyncpg/protocol/coreproto.pyx":830
 *     cdef _set_state(self, ProtocolState new_state):
 *         if new_state == PROTOCOL_IDLE:
 *             if self.state == PROTOCOL_FAILED:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to "idle" state; '
*/
      break;
      case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE:

      /* "asyncpg/protocol/coreproto.pyx":834
 *                     'cannot switch to "idle" state; '
 *                     'protocol is in the "failed" state')
 *             elif self.state == PROTOCOL_IDLE:             # <<<<<<<<<<<<<<
 *                 pass
 *             else:
*/
      break;
      default:

      /* "asyncpg/protocol/coreproto.pyx":837
 *                 pass
 *             else:
 *                 self.state = new_state             # <<<<<<<<<<<<<<
 * 
 *         elif new_state == PROTOCOL_FAILED:
*/
      __pyx_v_self->state = __pyx_v_new_state;
      break;
    }

    /* "asyncpg/protocol/coreproto.pyx":829
 * 
 *     cdef _set_state(self, ProtocolState new_state):
 *         if new_state == PROTOCOL_IDLE:             # <<<<<<<<<<<<<<
 *             if self.state == PROTOCOL_FAILED:
 *                 raise apg_exc.InternalClientError(
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED:

    /* "asyncpg/protocol/coreproto.pyx":840
 * 
 *         elif new_state == PROTOCOL_FAILED:
 *             self.state = PROTOCOL_FAILED             # <<<<<<<<<<<<<<
 * 
 *         elif new_state == PROTOCOL_CANCELLED:
*/
    __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED;

    /* "asyncpg/protocol/coreproto.pyx":839
 *                 self.state = new_state
 * 
 *         elif new_state == PROTOCOL_FAILED:             # <<<<<<<<<<<<<<
 *             self.state = PROTOCOL_FAILED
 * 
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED:

    /* "asyncpg/protocol/coreproto.pyx":843
 * 
 *         elif new_state == PROTOCOL_CANCELLED:
 *             self.state = PROTOCOL_CANCELLED             # <<<<<<<<<<<<<<
 * 
 *         elif new_state == PROTOCOL_TERMINATING:
*/
    __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED;

    /* "asyncpg/protocol/coreproto.pyx":842
 *             self.state = PROTOCOL_FAILED
 * 
 *         elif new_state == PROTOCOL_CANCELLED:             # <<<<<<<<<<<<<<
 *             self.state = PROTOCOL_CANCELLED
 * 
*/
    break;
    case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING:

    /* "asyncpg/protocol/coreproto.pyx":846
 * 
 *         elif new_state == PROTOCOL_TERMINATING:
 *             self.state = PROTOCOL_TERMINATING             # <<<<<<<<<<<<<<
 * 
 *         else:
*/
    __pyx_v_self->state = __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING;

    /* "asyncpg/protocol/coreproto.pyx":845
 *             self.state = PROTOCOL_CANCELLED
 * 
 *         elif new_state == PROTOCOL_TERMINATING:             # <<<<<<<<<<<<<<
 *             self.state = PROTOCOL_TERMINATING
 * 
*/
    break;
    default:

    /* "asyncpg/protocol/coreproto.pyx":849
 * 
 *         else:
 *             if self.state == PROTOCOL_IDLE:             # <<<<<<<<<<<<<<
 *                 self.state = new_state
 * 
*/
    __pyx_t_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_IDLE);
    if (__pyx_t_6) {

      /* "asyncpg/protocol/coreproto.pyx":850
 *         else:
 *             if self.state == PROTOCOL_IDLE:
 *                 self.state = new_state             # <<<<<<<<<<<<<<
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT and
*/
      __pyx_v_self->state = __pyx_v_new_state;

      /* "asyncpg/protocol/coreproto.pyx":849
 * 
 *         else:
 *             if self.state == PROTOCOL_IDLE:             # <<<<<<<<<<<<<<
 *                 self.state = new_state
 * 
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/coreproto.pyx":852
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DATA):
 *                 self.state = new_state
*/
    __pyx_t_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }

    /* "asyncpg/protocol/coreproto.pyx":853
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT and
 *                     new_state == PROTOCOL_COPY_OUT_DATA):             # <<<<<<<<<<<<<<
 *                 self.state = new_state
 * 
*/
    __pyx_t_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L4_bool_binop_done:;

    /* "asyncpg/protocol/coreproto.pyx":852
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DATA):
 *                 self.state = new_state
*/
    if (__pyx_t_6) {

      /* "asyncpg/protocol/coreproto.pyx":854
 *             elif (self.state == PROTOCOL_COPY_OUT and
 *                     new_state == PROTOCOL_COPY_OUT_DATA):
 *                 self.state = new_state             # <<<<<<<<<<<<<<
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and
*/
      __pyx_v_self->state = __pyx_v_new_state;

      /* "asyncpg/protocol/coreproto.pyx":852
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DATA):
 *                 self.state = new_state
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/coreproto.pyx":856
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DONE):
 *                 self.state = new_state
*/
    __pyx_t_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }

    /* "asyncpg/protocol/coreproto.pyx":857
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and
 *                     new_state == PROTOCOL_COPY_OUT_DONE):             # <<<<<<<<<<<<<<
 *                 self.state = new_state
 * 
*/
    __pyx_t_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;

    /* "asyncpg/protocol/coreproto.pyx":856
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DONE):
 *                 self.state = new_state
*/
    if (__pyx_t_6) {

      /* "asyncpg/protocol/coreproto.pyx":858
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and
 *                     new_state == PROTOCOL_COPY_OUT_DONE):
 *                 self.state = new_state             # <<<<<<<<<<<<<<
 * 
 *             elif (self.state == PROTOCOL_COPY_IN and
*/
      __pyx_v_self->state = __pyx_v_new_state;

      /* "asyncpg/protocol/coreproto.pyx":856
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_OUT_DONE):
 *                 self.state = new_state
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/coreproto.pyx":860
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_IN and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_IN_DATA):
 *                 self.state = new_state
*/
    __pyx_t_7 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L8_bool_binop_done;
    }

    /* "asyncpg/protocol/coreproto.pyx":861
 * 
 *             elif (self.state == PROTOCOL_COPY_IN and
 *                     new_state == PROTOCOL_COPY_IN_DATA):             # <<<<<<<<<<<<<<
 *                 self.state = new_state
 * 
*/
    __pyx_t_7 = (__pyx_v_new_state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L8_bool_binop_done:;

    /* "asyncpg/protocol/coreproto.pyx":860
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_IN and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_IN_DATA):
 *                 self.state = new_state
*/
    if (likely(__pyx_t_6)) {

      /* "asyncpg/protocol/coreproto.pyx":862
 *             elif (self.state == PROTOCOL_COPY_IN and
 *                     new_state == PROTOCOL_COPY_IN_DATA):
 *                 self.state = new_state             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_FAILED:
*/
      __pyx_v_self->state = __pyx_v_new_state;

      /* "asyncpg/protocol/coreproto.pyx":860
 *                 self.state = new_state
 * 
 *             elif (self.state == PROTOCOL_COPY_IN and             # <<<<<<<<<<<<<<
 *                     new_state == PROTOCOL_COPY_IN_DATA):
 *                 self.state = new_state
*/
      goto __pyx_L3;
    }

    /* "asyncpg/protocol/coreproto.pyx":864
 *                 self.state = new_state
 * 
 *             elif self.state == PROTOCOL_FAILED:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to state {}; '
*/
    __pyx_t_6 = (__pyx_v_self->state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED);
    if (unlikely(__pyx_t_6)) {

      /* "asyncpg/protocol/coreproto.pyx":865
 * 
 *             elif self.state == PROTOCOL_FAILED:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'cannot switch to state {}; '
 *                     'protocol is in the "failed" state'.format(new_state))
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":867
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to state {}; '
 *                     'protocol is in the "failed" state'.format(new_state))             # <<<<<<<<<<<<<<
 *             else:
 *                 raise apg_exc.InternalClientError(
*/
      __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_protocol;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 867, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(15, 865, __pyx_L1_error)

      /* "asyncpg/protocol/coreproto.pyx":864
 *                 self.state = new_state
 * 
 *             elif self.state == PROTOCOL_FAILED:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to state {}; '
*/
    }

    /* "asyncpg/protocol/coreproto.pyx":869
 *                     'protocol is in the "failed" state'.format(new_state))
 *             else:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'cannot switch to state {}; '
 *                     'another operation ({}) is in progress'.format(
*/
    /*else*/ {
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/coreproto.pyx":871
 *                 raise apg_exc.InternalClientError(
 *                     'cannot switch to state {}; '
 *                     'another operation ({}) is in progress'.format(             # <<<<<<<<<<<<<<
 *                         new_state, self.state))
 * 
*/
      __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_cannot_switch_to_state_another_o;
      __Pyx_INCREF(__pyx_t_9);

      /* "asyncpg/protocol/coreproto.pyx":872
 *                     'cannot switch to state {}; '
 *                     'another operation ({}) is in progress'.format(
 *                         new_state, self.state))             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_connected(self):
*/
      __pyx_t_8 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_new_state); if (unlikely(!__pyx_t_8)) __PYX_ERR(15, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 872, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 871, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_2};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 869, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(15, 869, __pyx_L1_error)
    }
    __pyx_L3:;
    break;
  }

  /* "asyncpg/protocol/coreproto.pyx":828
 *         self._execute_stmt_name = None
 * 
 *     cdef _set_state(self, ProtocolState new_state):             # <<<<<<<<<<<<<<
 *         if new_state == PROTOCOL_IDLE:
 *             if self.state == PROTOCOL_FAILED:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":874
 *                         new_state, self.state))
 * 
 *     cdef _ensure_connected(self):             # <<<<<<<<<<<<<<
 *         if self.con_status != CONNECTION_OK:
 *             raise apg_exc.InternalClientError('not connected')
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_connected", 0);

  /* "asyncpg/protocol/coreproto.pyx":875
 * 
 *     cdef _ensure_connected(self):
 *         if self.con_status != CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('not connected')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->con_status != __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/coreproto.pyx":876
 *     cdef _ensure_connected(self):
 *         if self.con_status != CONNECTION_OK:
 *             raise apg_exc.InternalClientError('not connected')             # <<<<<<<<<<<<<<
 * 
 *     cdef WriteBuffer _build_parse_message(self, str stmt_name, str query):
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_not_connected};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 876, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(15, 876, __pyx_L1_error)

    /* "asyncpg/protocol/coreproto.pyx":875
 * 
 *     cdef _ensure_connected(self):
 *         if self.con_status != CONNECTION_OK:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('not connected')
 * 
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":874
 *                         new_state, self.state))
 * 
 *     cdef _ensure_connected(self):             # <<<<<<<<<<<<<<
 *         if self.con_status != CONNECTION_OK:
 *             raise apg_exc.InternalClientError('not connected')
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._ensure_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":878
 *             raise apg_exc.InternalClientError('not connected')
 * 
 *     cdef WriteBuffer _build_parse_message(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_build_parse_message", 0);

  /* "asyncpg/protocol/coreproto.pyx":881
 *         cdef WriteBuffer buf
 * 
 *         buf = WriteBuffer.new_message(b'P')             # <<<<<<<<<<<<<<
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.write_str(query, self.encoding)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('P')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":882
 * 
 *         buf = WriteBuffer.new_message(b'P')
 *         buf.write_str(stmt_name, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.write_str(query, self.encoding)
 *         buf.write_int16(0)
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":883
 *         buf = WriteBuffer.new_message(b'P')
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.write_str(query, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)
 * 
*/
  __pyx_t_2 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":884
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.write_str(query, self.encoding)
 *         buf.write_int16(0)             # <<<<<<<<<<<<<<
 * 
 *         buf.end_message()
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":886
 *         buf.write_int16(0)
 * 
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         return buf
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":887
 * 
 *         buf.end_message()
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     cdef WriteBuffer _build_bind_message(self, str portal_name,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":878
 *             raise apg_exc.InternalClientError('not connected')
 * 
 *     cdef WriteBuffer _build_parse_message(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_parse_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":889
 *         return buf
 * 
 *     cdef WriteBuffer _build_bind_message(self, str portal_name,             # <<<<<<<<<<<<<<
 *                                          str stmt_name,
 *                                          WriteBuffer bind_data):
*/

static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_build_bind_message", 0);

  /* "asyncpg/protocol/coreproto.pyx":894
 *         cdef WriteBuffer buf
 * 
 *         buf = WriteBuffer.new_message(b'B')             # <<<<<<<<<<<<<<
 *         buf.write_str(portal_name, self.encoding)
 *         buf.write_str(stmt_name, self.encoding)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('B')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":895
 * 
 *         buf = WriteBuffer.new_message(b'B')
 *         buf.write_str(portal_name, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.write_str(stmt_name, self.encoding)
 * 
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":896
 *         buf = WriteBuffer.new_message(b'B')
 *         buf.write_str(portal_name, self.encoding)
 *         buf.write_str(stmt_name, self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         # Arguments
*/
  __pyx_t_2 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":899
 * 
 *         # Arguments
 *         buf.write_buffer(bind_data)             # <<<<<<<<<<<<<<
 * 
 *         buf.end_message()
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_bind_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":901
 *         buf.write_buffer(bind_data)
 * 
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         return buf
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":902
 * 
 *         buf.end_message()
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     cdef WriteBuffer _build_empty_bind_data(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":889
 *         return buf
 * 
 *     cdef WriteBuffer _build_bind_message(self, str portal_name,             # <<<<<<<<<<<<<<
 *                                          str stmt_name,
 *                                          WriteBuffer bind_data):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_bind_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":904
 *         return buf
 * 
 *     cdef WriteBuffer _build_empty_bind_data(self):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.new()
*/

static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_build_empty_bind_data", 0);

  /* "asyncpg/protocol/coreproto.pyx":906
 *     cdef WriteBuffer _build_empty_bind_data(self):
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # The number of parameter format codes
 *         buf.write_int16(0)  # The number of parameter values
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":907
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.new()
 *         buf.write_int16(0)  # The number of parameter format codes             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # The number of parameter values
 *         buf.write_int16(0)  # The number of result-column format codes
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":908
 *         buf = WriteBuffer.new()
 *         buf.write_int16(0)  # The number of parameter format codes
 *         buf.write_int16(0)  # The number of parameter values             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # The number of result-column format codes
 *         return buf
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":909
 *         buf.write_int16(0)  # The number of parameter format codes
 *         buf.write_int16(0)  # The number of parameter values
 *         buf.write_int16(0)  # The number of result-column format codes             # <<<<<<<<<<<<<<
 *         return buf
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":910
 *         buf.write_int16(0)  # The number of parameter values
 *         buf.write_int16(0)  # The number of result-column format codes
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     cdef WriteBuffer _build_execute_message(self, str portal_name,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":904
 *         return buf
 * 
 *     cdef WriteBuffer _build_empty_bind_data(self):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         buf = WriteBuffer.new()
*/

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

/* "asyncpg/protocol/coreproto.pyx":912
 *         return buf
 * 
 *     cdef WriteBuffer _build_execute_message(self, str portal_name,             # <<<<<<<<<<<<<<
 *                                             int32_t limit):
 *         cdef WriteBuffer buf
*/

static struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_build_execute_message", 0);

  /* "asyncpg/protocol/coreproto.pyx":916
 *         cdef WriteBuffer buf
 * 
 *         buf = WriteBuffer.new_message(b'E')             # <<<<<<<<<<<<<<
 *         buf.write_str(portal_name, self.encoding)  # name of the portal
 *         buf.write_int32(limit)  # number of rows to return; 0 - all
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('E')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":917
 * 
 *         buf = WriteBuffer.new_message(b'E')
 *         buf.write_str(portal_name, self.encoding)  # name of the portal             # <<<<<<<<<<<<<<
 *         buf.write_int32(limit)  # number of rows to return; 0 - all
 * 
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_portal_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":918
 *         buf = WriteBuffer.new_message(b'E')
 *         buf.write_str(portal_name, self.encoding)  # name of the portal
 *         buf.write_int32(limit)  # number of rows to return; 0 - all             # <<<<<<<<<<<<<<
 * 
 *         buf.end_message()
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":920
 *         buf.write_int32(limit)  # number of rows to return; 0 - all
 * 
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         return buf
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":921
 * 
 *         buf.end_message()
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     # API for subclasses
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":912
 *         return buf
 * 
 *     cdef WriteBuffer _build_execute_message(self, str portal_name,             # <<<<<<<<<<<<<<
 *                                             int32_t limit):
 *         cdef WriteBuffer buf
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._build_execute_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":925
 *     # API for subclasses
 * 
 *     cdef _connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_outbuf = 0;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int32_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_connect", 0);

  /* "asyncpg/protocol/coreproto.pyx":930
 *             WriteBuffer outbuf
 * 
 *         if self.con_status != CONNECTION_BAD:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('already connected')
 * 
*/
  __pyx_t_1 = (__pyx_v_self->con_status != __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/coreproto.pyx":931
 * 
 *         if self.con_status != CONNECTION_BAD:
 *             raise apg_exc.InternalClientError('already connected')             # <<<<<<<<<<<<<<
 * 
 *         self._set_state(PROTOCOL_AUTH)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_already_connected};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(15, 931, __pyx_L1_error)

    /* "asyncpg/protocol/coreproto.pyx":930
 *             WriteBuffer outbuf
 * 
 *         if self.con_status != CONNECTION_BAD:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('already connected')
 * 
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":933
 *             raise apg_exc.InternalClientError('already connected')
 * 
 *         self._set_state(PROTOCOL_AUTH)             # <<<<<<<<<<<<<<
 *         self.con_status = CONNECTION_STARTED
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":934
 * 
 *         self._set_state(PROTOCOL_AUTH)
 *         self.con_status = CONNECTION_STARTED             # <<<<<<<<<<<<<<
 * 
 *         # Assemble a startup message
*/
  __pyx_v_self->con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_STARTED;

  /* "asyncpg/protocol/coreproto.pyx":937
 * 
 *         # Assemble a startup message
 *         buf = WriteBuffer()             # <<<<<<<<<<<<<<
 * 
 *         # protocol version
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 937, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":940
 * 
 *         # protocol version
 *         buf.write_int16(3)             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":941
 *         # protocol version
 *         buf.write_int16(3)
 *         buf.write_int16(0)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytestring(b'client_encoding')
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":943
 *         buf.write_int16(0)
 * 
 *         buf.write_bytestring(b'client_encoding')             # <<<<<<<<<<<<<<
 *         buf.write_bytestring("'{}'".format(self.encoding).encode('ascii'))
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, __pyx_mstate_global->__pyx_n_b_client_encoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":944
 * 
 *         buf.write_bytestring(b'client_encoding')
 *         buf.write_bytestring("'{}'".format(self.encoding).encode('ascii'))             # <<<<<<<<<<<<<<
 * 
 *         buf.write_str('user', self.encoding)
*/
  __pyx_t_5 = __pyx_mstate_global->__pyx_kp_u__20;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_self->encoding};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":946
 *         buf.write_bytestring("'{}'".format(self.encoding).encode('ascii'))
 * 
 *         buf.write_str('user', self.encoding)             # <<<<<<<<<<<<<<
 *         buf.write_str(self.con_params.user, self.encoding)
 * 
*/
  __pyx_t_2 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_mstate_global->__pyx_n_u_user, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/coreproto.pyx":947
 * 
 *         buf.write_str('user', self.encoding)
 *         buf.write_str(self.con_params.user, self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_str('database', self.encoding)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_user); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(15, 947, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_5), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":949
 *         buf.write_str(self.con_params.user, self.encoding)
 * 
 *         buf.write_str('database', self.encoding)             # <<<<<<<<<<<<<<
 *         buf.write_str(self.con_params.database, self.encoding)
 * 
*/
  __pyx_t_3 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_mstate_global->__pyx_n_u_database, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":950
 * 
 *         buf.write_str('database', self.encoding)
 *         buf.write_str(self.con_params.database, self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         if self.con_params.server_settings is not None:
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(15, 950, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_2), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/coreproto.pyx":952
 *         buf.write_str(self.con_params.database, self.encoding)
 * 
 *         if self.con_params.server_settings is not None:             # <<<<<<<<<<<<<<
 *             for k, v in self.con_params.server_settings.items():
 *                 buf.write_str(k, self.encoding)
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_server_settings); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = (__pyx_t_5 != Py_None);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/coreproto.pyx":953
 * 
 *         if self.con_params.server_settings is not None:
 *             for k, v in self.con_params.server_settings.items():             # <<<<<<<<<<<<<<
 *                 buf.write_str(k, self.encoding)
 *                 buf.write_str(v, self.encoding)
*/
    __pyx_t_7 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->con_params, __pyx_mstate_global->__pyx_n_u_server_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(15, 953, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_8, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(15, 953, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "asyncpg/protocol/coreproto.pyx":954
 *         if self.con_params.server_settings is not None:
 *             for k, v in self.con_params.server_settings.items():
 *                 buf.write_str(k, self.encoding)             # <<<<<<<<<<<<<<
 *                 buf.write_str(v, self.encoding)
 * 
*/
      __pyx_t_3 = __pyx_v_k;
      __Pyx_INCREF(__pyx_t_3);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(15, 954, __pyx_L1_error)
      __pyx_t_2 = __pyx_v_self->encoding;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 954, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/coreproto.pyx":955
 *             for k, v in self.con_params.server_settings.items():
 *                 buf.write_str(k, self.encoding)
 *                 buf.write_str(v, self.encoding)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytestring(b'')
*/
      __pyx_t_4 = __pyx_v_v;
      __Pyx_INCREF(__pyx_t_4);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(15, 955, __pyx_L1_error)
      __pyx_t_2 = __pyx_v_self->encoding;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, ((PyObject*)__pyx_t_4), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 955, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/coreproto.pyx":952
 *         buf.write_str(self.con_params.database, self.encoding)
 * 
 *         if self.con_params.server_settings is not None:             # <<<<<<<<<<<<<<
 *             for k, v in self.con_params.server_settings.items():
 *                 buf.write_str(k, self.encoding)
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":957
 *                 buf.write_str(v, self.encoding)
 * 
 *         buf.write_bytestring(b'')             # <<<<<<<<<<<<<<
 * 
 *         # Send the buffer
*/
  __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytestring(__pyx_v_buf, __pyx_mstate_global->__pyx_kp_b__15); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "asyncpg/protocol/coreproto.pyx":960
 * 
 *         # Send the buffer
 *         outbuf = WriteBuffer()             # <<<<<<<<<<<<<<
 *         outbuf.write_int32(buf.len() + 4)
 *         outbuf.write_buffer(buf)
*/
  __pyx_t_3 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 960, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_outbuf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/coreproto.pyx":961
 *         # Send the buffer
 *         outbuf = WriteBuffer()
 *         outbuf.write_int32(buf.len() + 4)             # <<<<<<<<<<<<<<
 *         outbuf.write_buffer(buf)
 *         self._write(outbuf)
*/
  __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_buf); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyLong_AddObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __Pyx_PyLong_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(15, 961, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_int32(__pyx_v_outbuf, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":962
 *         outbuf = WriteBuffer()
 *         outbuf.write_int32(buf.len() + 4)
 *         outbuf.write_buffer(buf)             # <<<<<<<<<<<<<<
 *         self._write(outbuf)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_outbuf->__pyx_vtab)->write_buffer(__pyx_v_outbuf, __pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":963
 *         outbuf.write_int32(buf.len() + 4)
 *         outbuf.write_buffer(buf)
 *         self._write(outbuf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _send_parse_message(self, str stmt_name, str query):
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_outbuf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":925
 *     # API for subclasses
 * 
 *     cdef _connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF((PyObject *)__pyx_v_outbuf);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":965
 *         self._write(outbuf)
 * 
 *     cdef _send_parse_message(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_send_parse_message", 0);

  /* "asyncpg/protocol/coreproto.pyx":969
 *             WriteBuffer msg
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         msg = self._build_parse_message(stmt_name, query)
 *         self._write(msg)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":970
 * 
 *         self._ensure_connected()
 *         msg = self._build_parse_message(stmt_name, query)             # <<<<<<<<<<<<<<
 *         self._write(msg)
 * 
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_v_stmt_name, __pyx_v_query)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_msg = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":971
 *         self._ensure_connected()
 *         msg = self._build_parse_message(stmt_name, query)
 *         self._write(msg)             # <<<<<<<<<<<<<<
 * 
 *     cdef _prepare_and_describe(self, str stmt_name, str query):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_msg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":965
 *         self._write(outbuf)
 * 
 *     cdef _send_parse_message(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer msg
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._send_parse_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":973
 *         self._write(msg)
 * 
 *     cdef _prepare_and_describe(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_prepare_and_describe", 0);

  /* "asyncpg/protocol/coreproto.pyx":978
 *             WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_PREPARE)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":979
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_PREPARE)             # <<<<<<<<<<<<<<
 * 
 *         packet = self._build_parse_message(stmt_name, query)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":981
 *         self._set_state(PROTOCOL_PREPARE)
 * 
 *         packet = self._build_parse_message(stmt_name, query)             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(b'D')
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_v_stmt_name, __pyx_v_query)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_packet = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":983
 *         packet = self._build_parse_message(stmt_name, query)
 * 
 *         buf = WriteBuffer.new_message(b'D')             # <<<<<<<<<<<<<<
 *         buf.write_byte(b'S')
 *         buf.write_str(stmt_name, self.encoding)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('D')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":984
 * 
 *         buf = WriteBuffer.new_message(b'D')
 *         buf.write_byte(b'S')             # <<<<<<<<<<<<<<
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.end_message()
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":985
 *         buf = WriteBuffer.new_message(b'D')
 *         buf.write_byte(b'S')
 *         buf.write_str(stmt_name, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         packet.write_buffer(buf)
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_stmt_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":986
 *         buf.write_byte(b'S')
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         packet.write_buffer(buf)
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":987
 *         buf.write_str(stmt_name, self.encoding)
 *         buf.end_message()
 *         packet.write_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 *         packet.write_bytes(FLUSH_MESSAGE)
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":989
 *         packet.write_buffer(buf)
 * 
 *         packet.write_bytes(FLUSH_MESSAGE)             # <<<<<<<<<<<<<<
 * 
 *         self._write(packet)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FLUSH_MESSAGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 989, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":991
 *         packet.write_bytes(FLUSH_MESSAGE)
 * 
 *         self._write(packet)             # <<<<<<<<<<<<<<
 * 
 *     cdef _send_bind_message(self, str portal_name, str stmt_name,
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":973
 *         self._write(msg)
 * 
 *     cdef _prepare_and_describe(self, str stmt_name, str query):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._prepare_and_describe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_packet);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":993
 *         self._write(packet)
 * 
 *     cdef _send_bind_message(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                             WriteBuffer bind_data, int32_t limit):
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_send_bind_message", 0);

  /* "asyncpg/protocol/coreproto.pyx":1000
 *             WriteBuffer buf
 * 
 *         buf = self._build_bind_message(portal_name, stmt_name, bind_data)             # <<<<<<<<<<<<<<
 *         packet = buf
 * 
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1001
 * 
 *         buf = self._build_bind_message(portal_name, stmt_name, bind_data)
 *         packet = buf             # <<<<<<<<<<<<<<
 * 
 *         buf = self._build_execute_message(portal_name, limit)
*/
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_v_packet = __pyx_v_buf;

  /* "asyncpg/protocol/coreproto.pyx":1003
 *         packet = buf
 * 
 *         buf = self._build_execute_message(portal_name, limit)             # <<<<<<<<<<<<<<
 *         packet.write_buffer(buf)
 * 
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_limit)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1004
 * 
 *         buf = self._build_execute_message(portal_name, limit)
 *         packet.write_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 *         packet.write_bytes(SYNC_MESSAGE)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1006
 *         packet.write_buffer(buf)
 * 
 *         packet.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 * 
 *         self._write(packet)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 1006, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1008
 *         packet.write_bytes(SYNC_MESSAGE)
 * 
 *         self._write(packet)             # <<<<<<<<<<<<<<
 * 
 *     cdef _bind_execute(self, str portal_name, str stmt_name,
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":993
 *         self._write(packet)
 * 
 *     cdef _send_bind_message(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                             WriteBuffer bind_data, int32_t limit):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._send_bind_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_packet);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1010
 *         self._write(packet)
 * 
 *     cdef _bind_execute(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                        WriteBuffer bind_data, int32_t limit):
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data, int32_t __pyx_v_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind_execute", 0);

  /* "asyncpg/protocol/coreproto.pyx":1015
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_BIND_EXECUTE)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1016
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_BIND_EXECUTE)             # <<<<<<<<<<<<<<
 * 
 *         self.result = []
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1018
 *         self._set_state(PROTOCOL_BIND_EXECUTE)
 * 
 *         self.result = []             # <<<<<<<<<<<<<<
 * 
 *         self._send_bind_message(portal_name, stmt_name, bind_data, limit)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1020
 *         self.result = []
 * 
 *         self._send_bind_message(portal_name, stmt_name, bind_data, limit)             # <<<<<<<<<<<<<<
 * 
 *     cdef bint _bind_execute_many(self, str portal_name, str stmt_name,
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_send_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data, __pyx_v_limit); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1010
 *         self._write(packet)
 * 
 *     cdef _bind_execute(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                        WriteBuffer bind_data, int32_t limit):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1022
 *         self._send_bind_message(portal_name, stmt_name, bind_data, limit)
 * 
 *     cdef bint _bind_execute_many(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                                  object bind_data, bint return_rows):
 *         self._ensure_connected()
*/

static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_bind_data, int __pyx_v_return_rows) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind_execute_many", 0);

  /* "asyncpg/protocol/coreproto.pyx":1024
 *     cdef bint _bind_execute_many(self, str portal_name, str stmt_name,
 *                                  object bind_data, bint return_rows):
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_BIND_EXECUTE_MANY)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1025
 *                                  object bind_data, bint return_rows):
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_BIND_EXECUTE_MANY)             # <<<<<<<<<<<<<<
 * 
 *         self.result = [] if return_rows else None
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1027
 *         self._set_state(PROTOCOL_BIND_EXECUTE_MANY)
 * 
 *         self.result = [] if return_rows else None             # <<<<<<<<<<<<<<
 *         self._discard_data = not return_rows
 *         self._execute_iter = bind_data
*/
  if (__pyx_v_return_rows) {
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1027, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1028
 * 
 *         self.result = [] if return_rows else None
 *         self._discard_data = not return_rows             # <<<<<<<<<<<<<<
 *         self._execute_iter = bind_data
 *         self._execute_portal_name = portal_name
*/
  __pyx_v_self->_discard_data = (!__pyx_v_return_rows);

  /* "asyncpg/protocol/coreproto.pyx":1029
 *         self.result = [] if return_rows else None
 *         self._discard_data = not return_rows
 *         self._execute_iter = bind_data             # <<<<<<<<<<<<<<
 *         self._execute_portal_name = portal_name
 *         self._execute_stmt_name = stmt_name
*/
  __Pyx_INCREF(__pyx_v_bind_data);
  __Pyx_GIVEREF(__pyx_v_bind_data);
  __Pyx_GOTREF(__pyx_v_self->_execute_iter);
  __Pyx_DECREF(__pyx_v_self->_execute_iter);
  __pyx_v_self->_execute_iter = __pyx_v_bind_data;

  /* "asyncpg/protocol/coreproto.pyx":1030
 *         self._discard_data = not return_rows
 *         self._execute_iter = bind_data
 *         self._execute_portal_name = portal_name             # <<<<<<<<<<<<<<
 *         self._execute_stmt_name = stmt_name
 *         return self._bind_execute_many_more(True)
*/
  __Pyx_INCREF(__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_v_portal_name);
  __Pyx_GOTREF(__pyx_v_self->_execute_portal_name);
  __Pyx_DECREF(__pyx_v_self->_execute_portal_name);
  __pyx_v_self->_execute_portal_name = __pyx_v_portal_name;

  /* "asyncpg/protocol/coreproto.pyx":1031
 *         self._execute_iter = bind_data
 *         self._execute_portal_name = portal_name
 *         self._execute_stmt_name = stmt_name             # <<<<<<<<<<<<<<
 *         return self._bind_execute_many_more(True)
 * 
*/
  __Pyx_INCREF(__pyx_v_stmt_name);
  __Pyx_GIVEREF(__pyx_v_stmt_name);
  __Pyx_GOTREF(__pyx_v_self->_execute_stmt_name);
  __Pyx_DECREF(__pyx_v_self->_execute_stmt_name);
  __pyx_v_self->_execute_stmt_name = __pyx_v_stmt_name;

  /* "asyncpg/protocol/coreproto.pyx":1032
 *         self._execute_portal_name = portal_name
 *         self._execute_stmt_name = stmt_name
 *         return self._bind_execute_many_more(True)             # <<<<<<<<<<<<<<
 * 
 *     cdef bint _bind_execute_many_more(self, bint first=False):
*/
  __pyx_t_4.__pyx_n = 1;
  __pyx_t_4.first = 1;
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_bind_execute_many_more(__pyx_v_self, &__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 1032, __pyx_L1_error)
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":1022
 *         self._send_bind_message(portal_name, stmt_name, bind_data, limit)
 * 
 *     cdef bint _bind_execute_many(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                                  object bind_data, bint return_rows):
 *         self._ensure_connected()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1034
 *         return self._bind_execute_many_more(True)
 * 
 *     cdef bint _bind_execute_many_more(self, bint first=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
*/

static int __pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args) {
  int __pyx_v_first = ((int)0);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet = 0;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_buffers = 0;
  PyObject *__pyx_v_ex = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind_execute_many_more", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_first = __pyx_optional_args->first;
    }
  }

  /* "asyncpg/protocol/coreproto.pyx":1038
 *             WriteBuffer packet
 *             WriteBuffer buf
 *             list buffers = []             # <<<<<<<<<<<<<<
 * 
 *         # as we keep sending, the server may return an error early
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1041
 * 
 *         # as we keep sending, the server may return an error early
 *         if self.result_type == RESULT_FAILED:             # <<<<<<<<<<<<<<
 *             self._write(SYNC_MESSAGE)
 *             return False
*/
  __pyx_t_2 = (__pyx_v_self->result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/coreproto.pyx":1042
 *         # as we keep sending, the server may return an error early
 *         if self.result_type == RESULT_FAILED:
 *             self._write(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *             return False
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1043
 *         if self.result_type == RESULT_FAILED:
 *             self._write(SYNC_MESSAGE)
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         # collect up to four 32KB buffers to send
*/
    __pyx_r = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/coreproto.pyx":1041
 * 
 *         # as we keep sending, the server may return an error early
 *         if self.result_type == RESULT_FAILED:             # <<<<<<<<<<<<<<
 *             self._write(SYNC_MESSAGE)
 *             return False
*/
  }

  /* "asyncpg/protocol/coreproto.pyx":1047
 *         # collect up to four 32KB buffers to send
 *         # https://github.com/MagicStack/asyncpg/pull/289#issuecomment-391215051
 *         while len(buffers) < _EXECUTE_MANY_BUF_NUM:             # <<<<<<<<<<<<<<
 *             packet = WriteBuffer.new()
 * 
*/
  while (1) {
    __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_buffers); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(15, 1047, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_4 < 4);
    if (!__pyx_t_2) break;

    /* "asyncpg/protocol/coreproto.pyx":1048
 *         # https://github.com/MagicStack/asyncpg/pull/289#issuecomment-391215051
 *         while len(buffers) < _EXECUTE_MANY_BUF_NUM:
 *             packet = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *             # fill one 32KB buffer
*/
    __pyx_t_3 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1051
 * 
 *             # fill one 32KB buffer
 *             while packet.len() < _EXECUTE_MANY_BUF_SIZE:             # <<<<<<<<<<<<<<
 *                 try:
 *                     # grab one item from the input
*/
    while (1) {
      __pyx_t_3 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_packet); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1051, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_mstate_global->__pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1051, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 1051, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_2) break;

      /* "asyncpg/protocol/coreproto.pyx":1052
 *             # fill one 32KB buffer
 *             while packet.len() < _EXECUTE_MANY_BUF_SIZE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     # grab one item from the input
 *                     buf = <WriteBuffer>next(self._execute_iter)
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {

          /* "asyncpg/protocol/coreproto.pyx":1054
 *                 try:
 *                     # grab one item from the input
 *                     buf = <WriteBuffer>next(self._execute_iter)             # <<<<<<<<<<<<<<
 * 
 *                 # reached the end of the input
*/
          __pyx_t_1 = __pyx_v_self->_execute_iter;
          __Pyx_INCREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1054, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = __pyx_t_3;
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1));
          __pyx_t_1 = 0;

          /* "asyncpg/protocol/coreproto.pyx":1052
 *             # fill one 32KB buffer
 *             while packet.len() < _EXECUTE_MANY_BUF_SIZE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     # grab one item from the input
 *                     buf = <WriteBuffer>next(self._execute_iter)
*/
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/coreproto.pyx":1057
 * 
 *                 # reached the end of the input
 *                 except StopIteration:             # <<<<<<<<<<<<<<
 *                     if first:
 *                         # if we never send anything, simply set the result
*/
        __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_StopIteration))));
        if (__pyx_t_8) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(15, 1057, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_9);

          /* "asyncpg/protocol/coreproto.pyx":1058
 *                 # reached the end of the input
 *                 except StopIteration:
 *                     if first:             # <<<<<<<<<<<<<<
 *                         # if we never send anything, simply set the result
 *                         self._push_result()
*/
          if (__pyx_v_first) {

            /* "asyncpg/protocol/coreproto.pyx":1060
 *                     if first:
 *                         # if we never send anything, simply set the result
 *                         self._push_result()             # <<<<<<<<<<<<<<
 *                     else:
 *                         # otherwise, append SYNC and send the buffers
*/
            __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 1060, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "asyncpg/protocol/coreproto.pyx":1058
 *                 # reached the end of the input
 *                 except StopIteration:
 *                     if first:             # <<<<<<<<<<<<<<
 *                         # if we never send anything, simply set the result
 *                         self._push_result()
*/
            goto __pyx_L18;
          }

          /* "asyncpg/protocol/coreproto.pyx":1063
 *                     else:
 *                         # otherwise, append SYNC and send the buffers
 *                         packet.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *                         buffers.append(memoryview(packet))
 *                         self._writelines(buffers)
*/
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 1063, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_10);
            if (!(likely(PyBytes_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_10))) __PYX_ERR(15, 1063, __pyx_L10_except_error)
            __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_v_packet, ((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 1063, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

            /* "asyncpg/protocol/coreproto.pyx":1064
 *                         # otherwise, append SYNC and send the buffers
 *                         packet.write_bytes(SYNC_MESSAGE)
 *                         buffers.append(memoryview(packet))             # <<<<<<<<<<<<<<
 *                         self._writelines(buffers)
 *                     return False
*/
            __pyx_t_11 = PyMemoryView_FromObject(((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 1064, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(15, 1064, __pyx_L10_except_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

            /* "asyncpg/protocol/coreproto.pyx":1065
 *                         packet.write_bytes(SYNC_MESSAGE)
 *                         buffers.append(memoryview(packet))
 *                         self._writelines(buffers)             # <<<<<<<<<<<<<<
 *                     return False
 * 
*/
            __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_writelines(__pyx_v_self, __pyx_v_buffers); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 1065, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          __pyx_L18:;

          /* "asyncpg/protocol/coreproto.pyx":1066
 *                         buffers.append(memoryview(packet))
 *                         self._writelines(buffers)
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 # error in input, give up the buffers and cleanup
*/
          __pyx_r = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L11_except_return;
        }

        /* "asyncpg/protocol/coreproto.pyx":1069
 * 
 *                 # error in input, give up the buffers and cleanup
 *                 except Exception as ex:             # <<<<<<<<<<<<<<
 *                     self._bind_execute_many_fail(ex, first)
 *                     return False
*/
        __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_8) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(15, 1069, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_v_ex = __pyx_t_3;
          /*try:*/ {

            /* "asyncpg/protocol/coreproto.pyx":1070
 *                 # error in input, give up the buffers and cleanup
 *                 except Exception as ex:
 *                     self._bind_execute_many_fail(ex, first)             # <<<<<<<<<<<<<<
 *                     return False
 * 
*/
            __pyx_t_13.__pyx_n = 1;
            __pyx_t_13.first = __pyx_v_first;
            __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_bind_execute_many_fail(__pyx_v_self, __pyx_v_ex, &__pyx_t_13); if (unlikely(!__pyx_t_11)) __PYX_ERR(15, 1070, __pyx_L24_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

            /* "asyncpg/protocol/coreproto.pyx":1071
 *                 except Exception as ex:
 *                     self._bind_execute_many_fail(ex, first)
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 # all good, write to the buffer
*/
            __pyx_r = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L23_return;
          }

          /* "asyncpg/protocol/coreproto.pyx":1069
 * 
 *                 # error in input, give up the buffers and cleanup
 *                 except Exception as ex:             # <<<<<<<<<<<<<<
 *                     self._bind_execute_many_fail(ex, first)
 *                     return False
*/
          /*finally:*/ {
            __pyx_L24_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
              if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __Pyx_XGOTREF(__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_19);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_21);
              __pyx_t_8 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
              __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
              goto __pyx_L10_except_error;
            }
            __pyx_L23_return: {
              __pyx_t_2 = __pyx_r;
              __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
              __pyx_r = __pyx_t_2;
              goto __pyx_L11_except_return;
            }
          }
        }
        goto __pyx_L10_except_error;

        /* "asyncpg/protocol/coreproto.pyx":1052
 *             # fill one 32KB buffer
 *             while packet.len() < _EXECUTE_MANY_BUF_SIZE:
 *                 try:             # <<<<<<<<<<<<<<
 *                     # grab one item from the input
 *                     buf = <WriteBuffer>next(self._execute_iter)
*/
        __pyx_L10_except_error:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L11_except_return:;
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L0;
        __pyx_L15_try_end:;
      }

      /* "asyncpg/protocol/coreproto.pyx":1074
 * 
 *                 # all good, write to the buffer
 *                 first = False             # <<<<<<<<<<<<<<
 *                 packet.write_buffer(
 *                     self._build_bind_message(
*/
      __pyx_v_first = 0;

      /* "asyncpg/protocol/coreproto.pyx":1077
 *                 packet.write_buffer(
 *                     self._build_bind_message(
 *                         self._execute_portal_name,             # <<<<<<<<<<<<<<
 *                         self._execute_stmt_name,
 *                         buf,
*/
      __pyx_t_1 = __pyx_v_self->_execute_portal_name;
      __Pyx_INCREF(__pyx_t_1);

      /* "asyncpg/protocol/coreproto.pyx":1078
 *                     self._build_bind_message(
 *                         self._execute_portal_name,
 *                         self._execute_stmt_name,             # <<<<<<<<<<<<<<
 *                         buf,
 *                     )
*/
      __pyx_t_3 = __pyx_v_self->_execute_stmt_name;
      __Pyx_INCREF(__pyx_t_3);

      /* "asyncpg/protocol/coreproto.pyx":1076
 *                 first = False
 *                 packet.write_buffer(
 *                     self._build_bind_message(             # <<<<<<<<<<<<<<
 *                         self._execute_portal_name,
 *                         self._execute_stmt_name,
*/
      __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_3), __pyx_v_buf)); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 1076, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/coreproto.pyx":1075
 *                 # all good, write to the buffer
 *                 first = False
 *                 packet.write_buffer(             # <<<<<<<<<<<<<<
 *                     self._build_bind_message(
 *                         self._execute_portal_name,
*/
      __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1075, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/coreproto.pyx":1083
 *                 )
 *                 packet.write_buffer(
 *                     self._build_execute_message(self._execute_portal_name, 0,             # <<<<<<<<<<<<<<
 *                     )
 *                 )
*/
      __pyx_t_3 = __pyx_v_self->_execute_portal_name;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, ((PyObject*)__pyx_t_3), 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 1083, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/coreproto.pyx":1082
 *                     )
 *                 )
 *                 packet.write_buffer(             # <<<<<<<<<<<<<<
 *                     self._build_execute_message(self._execute_portal_name, 0,
 *                     )
*/
      __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_v_packet, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "asyncpg/protocol/coreproto.pyx":1088
 * 
 *             # collected one buffer
 *             buffers.append(memoryview(packet))             # <<<<<<<<<<<<<<
 * 
 *         # write to the wire, and signal the caller for more to send
*/
    __pyx_t_3 = PyMemoryView_FromObject(((PyObject *)__pyx_v_packet)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_buffers, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(15, 1088, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "asyncpg/protocol/coreproto.pyx":1091
 * 
 *         # write to the wire, and signal the caller for more to send
 *         self._writelines(buffers)             # <<<<<<<<<<<<<<
 *         return True
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_writelines(__pyx_v_self, __pyx_v_buffers); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1092
 *         # write to the wire, and signal the caller for more to send
 *         self._writelines(buffers)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cdef _bind_execute_many_fail(self, object error, bint first=False):
*/
  __pyx_r = 1;
  goto __pyx_L0;

  /* "asyncpg/protocol/coreproto.pyx":1034
 *         return self._bind_execute_many_more(True)
 * 
 *     cdef bint _bind_execute_many_more(self, bint first=False):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_more", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_packet);
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_buffers);
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1094
 *         return True
 * 
 *     cdef _bind_execute_many_fail(self, object error, bint first=False):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_error, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args) {
  int __pyx_v_first = ((int)0);
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind_execute_many_fail", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_first = __pyx_optional_args->first;
    }
  }

  /* "asyncpg/protocol/coreproto.pyx":1097
 *         cdef WriteBuffer buf
 * 
 *         self.result_type = RESULT_FAILED             # <<<<<<<<<<<<<<
 *         self.result = error
 *         if first:
*/
  __pyx_v_self->result_type = __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED;

  /* "asyncpg/protocol/coreproto.pyx":1098
 * 
 *         self.result_type = RESULT_FAILED
 *         self.result = error             # <<<<<<<<<<<<<<
 *         if first:
 *             self._push_result()
*/
  __Pyx_INCREF(__pyx_v_error);
  __Pyx_GIVEREF(__pyx_v_error);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = __pyx_v_error;

  /* "asyncpg/protocol/coreproto.pyx":1099
 *         self.result_type = RESULT_FAILED
 *         self.result = error
 *         if first:             # <<<<<<<<<<<<<<
 *             self._push_result()
 *         elif self.is_in_transaction():
*/
  if (__pyx_v_first) {

    /* "asyncpg/protocol/coreproto.pyx":1100
 *         self.result = error
 *         if first:
 *             self._push_result()             # <<<<<<<<<<<<<<
 *         elif self.is_in_transaction():
 *             # we're in an explicit transaction, just SYNC
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_push_result(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1099
 *         self.result_type = RESULT_FAILED
 *         self.result = error
 *         if first:             # <<<<<<<<<<<<<<
 *             self._push_result()
 *         elif self.is_in_transaction():
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":1101
 *         if first:
 *             self._push_result()
 *         elif self.is_in_transaction():             # <<<<<<<<<<<<<<
 *             # we're in an explicit transaction, just SYNC
 *             self._write(SYNC_MESSAGE)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->is_in_transaction(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(15, 1101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/coreproto.pyx":1103
 *         elif self.is_in_transaction():
 *             # we're in an explicit transaction, just SYNC
 *             self._write(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         else:
 *             # In an implicit transaction, if `ignore_till_sync` is set,
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1101
 *         if first:
 *             self._push_result()
 *         elif self.is_in_transaction():             # <<<<<<<<<<<<<<
 *             # we're in an explicit transaction, just SYNC
 *             self._write(SYNC_MESSAGE)
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":1112
 *             # GOTCHA: cannot use simple query message here, because it is
 *             # ignored if `ignore_till_sync` is set.
 *             buf = self._build_parse_message('', 'ROLLBACK')             # <<<<<<<<<<<<<<
 *             buf.write_buffer(self._build_bind_message(
 *                 '', '', self._build_empty_bind_data()))
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_parse_message(__pyx_v_self, __pyx_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_n_u_ROLLBACK)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1114
 *             buf = self._build_parse_message('', 'ROLLBACK')
 *             buf.write_buffer(self._build_bind_message(
 *                 '', '', self._build_empty_bind_data()))             # <<<<<<<<<<<<<<
 *             buf.write_buffer(self._build_execute_message('', 0))
 *             buf.write_bytes(SYNC_MESSAGE)
*/
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_empty_bind_data(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asyncpg/protocol/coreproto.pyx":1113
 *             # ignored if `ignore_till_sync` is set.
 *             buf = self._build_parse_message('', 'ROLLBACK')
 *             buf.write_buffer(self._build_bind_message(             # <<<<<<<<<<<<<<
 *                 '', '', self._build_empty_bind_data()))
 *             buf.write_buffer(self._build_execute_message('', 0))
*/
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_kp_u__15, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1115
 *             buf.write_buffer(self._build_bind_message(
 *                 '', '', self._build_empty_bind_data()))
 *             buf.write_buffer(self._build_execute_message('', 0))             # <<<<<<<<<<<<<<
 *             buf.write_bytes(SYNC_MESSAGE)
 *             self._write(buf)
*/
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_mstate_global->__pyx_kp_u__15, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1116
 *                 '', '', self._build_empty_bind_data()))
 *             buf.write_buffer(self._build_execute_message('', 0))
 *             buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *             self._write(buf)
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 1116, __pyx_L1_error)
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1117
 *             buf.write_buffer(self._build_execute_message('', 0))
 *             buf.write_bytes(SYNC_MESSAGE)
 *             self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _execute(self, str portal_name, int32_t limit):
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 1117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/coreproto.pyx":1094
 *         return True
 * 
 *     cdef _bind_execute_many_fail(self, object error, bint first=False):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind_execute_many_fail", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1119
 *             self._write(buf)
 * 
 *     cdef _execute(self, str portal_name, int32_t limit):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, int32_t __pyx_v_limit) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_execute", 0);

  /* "asyncpg/protocol/coreproto.pyx":1122
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_EXECUTE)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1123
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_EXECUTE)             # <<<<<<<<<<<<<<
 * 
 *         self.result = []
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1125
 *         self._set_state(PROTOCOL_EXECUTE)
 * 
 *         self.result = []             # <<<<<<<<<<<<<<
 * 
 *         buf = self._build_execute_message(portal_name, limit)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->result);
  __Pyx_DECREF(__pyx_v_self->result);
  __pyx_v_self->result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1127
 *         self.result = []
 * 
 *         buf = self._build_execute_message(portal_name, limit)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytes(SYNC_MESSAGE)
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_execute_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_limit)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1129
 *         buf = self._build_execute_message(portal_name, limit)
 * 
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 * 
 *         self._write(buf)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 1129, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1131
 *         buf.write_bytes(SYNC_MESSAGE)
 * 
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _bind(self, str portal_name, str stmt_name,
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1119
 *             self._write(buf)
 * 
 *     cdef _execute(self, str portal_name, int32_t limit):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1133
 *         self._write(buf)
 * 
 *     cdef _bind(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                WriteBuffer bind_data):
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_stmt_name, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_bind_data) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_bind", 0);

  /* "asyncpg/protocol/coreproto.pyx":1138
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_BIND)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1139
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_BIND)             # <<<<<<<<<<<<<<
 * 
 *         buf = self._build_bind_message(portal_name, stmt_name, bind_data)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1141
 *         self._set_state(PROTOCOL_BIND)
 * 
 *         buf = self._build_bind_message(portal_name, stmt_name, bind_data)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytes(SYNC_MESSAGE)
*/
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_build_bind_message(__pyx_v_self, __pyx_v_portal_name, __pyx_v_stmt_name, __pyx_v_bind_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1143
 *         buf = self._build_bind_message(portal_name, stmt_name, bind_data)
 * 
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 * 
 *         self._write(buf)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(15, 1143, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1145
 *         buf.write_bytes(SYNC_MESSAGE)
 * 
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _close(self, str name, bint is_portal):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1133
 *         self._write(buf)
 * 
 *     cdef _bind(self, str portal_name, str stmt_name,             # <<<<<<<<<<<<<<
 *                WriteBuffer bind_data):
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1147
 *         self._write(buf)
 * 
 *     cdef _close(self, str name, bint is_portal):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_name, int __pyx_v_is_portal) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_close", 0);

  /* "asyncpg/protocol/coreproto.pyx":1150
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_CLOSE_STMT_PORTAL)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1151
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_CLOSE_STMT_PORTAL)             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(b'C')
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1153
 *         self._set_state(PROTOCOL_CLOSE_STMT_PORTAL)
 * 
 *         buf = WriteBuffer.new_message(b'C')             # <<<<<<<<<<<<<<
 * 
 *         if is_portal:
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('C')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1155
 *         buf = WriteBuffer.new_message(b'C')
 * 
 *         if is_portal:             # <<<<<<<<<<<<<<
 *             buf.write_byte(b'P')
 *         else:
*/
  if (__pyx_v_is_portal) {

    /* "asyncpg/protocol/coreproto.pyx":1156
 * 
 *         if is_portal:
 *             buf.write_byte(b'P')             # <<<<<<<<<<<<<<
 *         else:
 *             buf.write_byte(b'S')
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'P'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/coreproto.pyx":1155
 *         buf = WriteBuffer.new_message(b'C')
 * 
 *         if is_portal:             # <<<<<<<<<<<<<<
 *             buf.write_byte(b'P')
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/coreproto.pyx":1158
 *             buf.write_byte(b'P')
 *         else:
 *             buf.write_byte(b'S')             # <<<<<<<<<<<<<<
 * 
 *         buf.write_str(name, self.encoding)
*/
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, 'S'); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/coreproto.pyx":1160
 *             buf.write_byte(b'S')
 * 
 *         buf.write_str(name, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 * 
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_name, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1161
 * 
 *         buf.write_str(name, self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytes(SYNC_MESSAGE)
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1163
 *         buf.end_message()
 * 
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 * 
 *         self._write(buf)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(15, 1163, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1165
 *         buf.write_bytes(SYNC_MESSAGE)
 * 
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _simple_query(self, str query):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1147
 *         self._write(buf)
 * 
 *     cdef _close(self, str name, bint is_portal):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1167
 *         self._write(buf)
 * 
 *     cdef _simple_query(self, str query):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_query) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_simple_query", 0);

  /* "asyncpg/protocol/coreproto.pyx":1169
 *     cdef _simple_query(self, str query):
 *         cdef WriteBuffer buf
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_SIMPLE_QUERY)
 *         buf = WriteBuffer.new_message(b'Q')
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1170
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_SIMPLE_QUERY)             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(query, self.encoding)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1171
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_SIMPLE_QUERY)
 *         buf = WriteBuffer.new_message(b'Q')             # <<<<<<<<<<<<<<
 *         buf.write_str(query, self.encoding)
 *         buf.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1172
 *         self._set_state(PROTOCOL_SIMPLE_QUERY)
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(query, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_query, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1173
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(query, self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1174
 *         buf.write_str(query, self.encoding)
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _copy_out(self, str copy_stmt):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1167
 *         self._write(buf)
 * 
 *     cdef _simple_query(self, str query):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1176
 *         self._write(buf)
 * 
 *     cdef _copy_out(self, str copy_stmt):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_copy_out", 0);

  /* "asyncpg/protocol/coreproto.pyx":1179
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_COPY_OUT)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1180
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_COPY_OUT)             # <<<<<<<<<<<<<<
 * 
 *         # Send the COPY .. TO STDOUT using the SimpleQuery protocol.
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1183
 * 
 *         # Send the COPY .. TO STDOUT using the SimpleQuery protocol.
 *         buf = WriteBuffer.new_message(b'Q')             # <<<<<<<<<<<<<<
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1184
 *         # Send the COPY .. TO STDOUT using the SimpleQuery protocol.
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(copy_stmt, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1185
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1186
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _copy_in(self, str copy_stmt):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1176
 *         self._write(buf)
 * 
 *     cdef _copy_out(self, str copy_stmt):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1188
 *         self._write(buf)
 * 
 *     cdef _copy_in(self, str copy_stmt):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_copy_in", 0);

  /* "asyncpg/protocol/coreproto.pyx":1191
 *         cdef WriteBuffer buf
 * 
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_COPY_IN)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1192
 * 
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_COPY_IN)             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(b'Q')
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1194
 *         self._set_state(PROTOCOL_COPY_IN)
 * 
 *         buf = WriteBuffer.new_message(b'Q')             # <<<<<<<<<<<<<<
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1195
 * 
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(copy_stmt, self.encoding)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_1 = __pyx_v_self->encoding;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_str(__pyx_v_buf, __pyx_v_copy_stmt, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1196
 *         buf = WriteBuffer.new_message(b'Q')
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1197
 *         buf.write_str(copy_stmt, self.encoding)
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _terminate(self):
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1188
 *         self._write(buf)
 * 
 *     cdef _copy_in(self, str copy_stmt):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1199
 *         self._write(buf)
 * 
 *     cdef _terminate(self):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_terminate", 0);

  /* "asyncpg/protocol/coreproto.pyx":1201
 *     cdef _terminate(self):
 *         cdef WriteBuffer buf
 *         self._ensure_connected()             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_TERMINATING)
 *         buf = WriteBuffer.new_message(b'X')
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_ensure_connected(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1202
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_TERMINATING)             # <<<<<<<<<<<<<<
 *         buf = WriteBuffer.new_message(b'X')
 *         buf.end_message()
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_set_state(__pyx_v_self, __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1203
 *         self._ensure_connected()
 *         self._set_state(PROTOCOL_TERMINATING)
 *         buf = WriteBuffer.new_message(b'X')             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self._write(buf)
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('X')); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1204
 *         self._set_state(PROTOCOL_TERMINATING)
 *         buf = WriteBuffer.new_message(b'X')
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self._write(buf)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->end_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1205
 *         buf = WriteBuffer.new_message(b'X')
 *         buf.end_message()
 *         self._write(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef _write(self, buf):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1199
 *         self._write(buf)
 * 
 *     cdef _terminate(self):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 *         self._ensure_connected()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._terminate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1207
 *         self._write(buf)
 * 
 *     cdef _write(self, buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write", 0);

  /* "asyncpg/protocol/coreproto.pyx":1208
 * 
 *     cdef _write(self, buf):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef _writelines(self, list buffers):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(15, 1208, __pyx_L1_error)

  /* "asyncpg/protocol/coreproto.pyx":1207
 *         self._write(buf)
 * 
 *     cdef _write(self, buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1210
 *         raise NotImplementedError
 * 
 *     cdef _writelines(self, list buffers):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_buffers) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_writelines", 0);

  /* "asyncpg/protocol/coreproto.pyx":1211
 * 
 *     cdef _writelines(self, list buffers):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(15, 1211, __pyx_L1_error)

  /* "asyncpg/protocol/coreproto.pyx":1210
 *         raise NotImplementedError
 * 
 *     cdef _writelines(self, list buffers):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol._writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1213
 *         raise NotImplementedError
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED char const *__pyx_v_buf, CYTHON_UNUSED Py_ssize_t __pyx_v_buf_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_decode_row", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1216
 *         pass
 * 
 *     cdef _set_server_parameter(self, name, val):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_name, CYTHON_UNUSED PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_server_parameter", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1219
 *         pass
 * 
 *     cdef _on_result(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_result", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1222
 *         pass
 * 
 *     cdef _on_notice(self, parsed):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_parsed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_notice", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1225
 *         pass
 * 
 *     cdef _on_notification(self, pid, channel, payload):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_pid, CYTHON_UNUSED PyObject *__pyx_v_channel, CYTHON_UNUSED PyObject *__pyx_v_payload) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_notification", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pyx":1228
 *         pass
 * 
 *     cdef _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         pass
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_connection_lost", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pxd":97
 *         object gss_ctx
 * 
 *         readonly int32_t backend_pid             # <<<<<<<<<<<<<<
 *         readonly int32_t backend_secret
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.backend_pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/coreproto.pxd":98
 * 
 *         readonly int32_t backend_pid
 *         readonly int32_t backend_secret             # <<<<<<<<<<<<<<
 * 
 *         ## Result
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.backend_secret.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_4__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_skip_discard); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_pid); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int32_t(__pyx_v_self->backend_secret); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->con_status); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->result_execute_completed); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->result_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->state); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->xact_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(23); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_execute_iter);
  __Pyx_GIVEREF(__pyx_v_self->_execute_iter);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->_execute_iter) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_execute_portal_name);
  __Pyx_GIVEREF(__pyx_v_self->_execute_portal_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_self->_execute_portal_name) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_execute_stmt_name);
  __Pyx_GIVEREF(__pyx_v_self->_execute_stmt_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_self->_execute_stmt_name) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_2) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->address);
  __Pyx_GIVEREF(__pyx_v_self->address);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_v_self->address) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_3) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_4) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->buffer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->buffer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 8, ((PyObject *)__pyx_v_self->buffer)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->con_params);
  __Pyx_GIVEREF(__pyx_v_self->con_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_v_self->con_params) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_5) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->encoding);
  __Pyx_GIVEREF(__pyx_v_self->encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_v_self->encoding) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->gss_ctx);
  __Pyx_GIVEREF(__pyx_v_self->gss_ctx);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_v_self->gss_ctx) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->result);
  __Pyx_GIVEREF(__pyx_v_self->result);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 13, __pyx_v_self->result) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 14, __pyx_t_6) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->result_param_desc);
  __Pyx_GIVEREF(__pyx_v_self->result_param_desc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 15, __pyx_v_self->result_param_desc) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->result_row_desc);
  __Pyx_GIVEREF(__pyx_v_self->result_row_desc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 16, __pyx_v_self->result_row_desc) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->result_status_msg);
  __Pyx_GIVEREF(__pyx_v_self->result_status_msg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 17, __pyx_v_self->result_status_msg) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_t_7) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->scram);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->scram);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 19, ((PyObject *)__pyx_v_self->scram)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 20, __pyx_t_8) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->transport);
  __Pyx_GIVEREF(__pyx_v_self->transport);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 21, __pyx_v_self->transport) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 22, __pyx_t_9) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_v__dict = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "(tree fragment)":7
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_12 = (__pyx_v__dict != Py_None);
  if (__pyx_t_12) {
  } else {
    __pyx_t_11 = __pyx_t_12;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(9, 7, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_12;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict) != (0)) __PYX_ERR(9, 8, __pyx_L1_error);
    __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.con_params, self.con_status, self.encoding, self.gss_ctx, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.scram, self.state, self.transport, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state
*/
  /*else*/ {
    __pyx_t_12 = (__pyx_v_self->_execute_iter != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->_execute_portal_name != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->_execute_stmt_name != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->address != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->buffer) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->con_params != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->encoding != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->gss_ctx != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->result != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->result_param_desc != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->result_row_desc != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->result_status_msg != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->scram) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->transport != Py_None);
    __pyx_t_11 = __pyx_t_12;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_11;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None
 *     if use_setstate:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_175807176);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_175807176);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_175807176) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.con_params is not None or self.encoding is not None or self.gss_ctx is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.transport is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, None), state
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_175807176);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_175807176);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_mstate_global->__pyx_int_175807176) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12CoreProtocol_6__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(9, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.CoreProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":14
 * cdef class PreparedStatementState:
 * 
 *     def __cinit__(             # <<<<<<<<<<<<<<
 *         self,
 *         str name,
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_query = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol = 0;
  PyTypeObject *__pyx_v_record_class = 0;
  int __pyx_v_ignore_custom_codec;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_protocol,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(17, 14, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(17, 14, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, i); __PYX_ERR(17, 14, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(17, 14, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(17, 14, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(17, 14, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(17, 14, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(17, 14, __pyx_L3_error)
    }
    __pyx_v_name = ((PyObject*)values[0]);
    __pyx_v_query = ((PyObject*)values[1]);
    __pyx_v_protocol = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)values[2]);
    __pyx_v_record_class = ((PyTypeObject*)values[3]);
    __pyx_v_ignore_custom_codec = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_ignore_custom_codec == (int)-1) && PyErr_Occurred())) __PYX_ERR(17, 20, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, __pyx_nargs); __PYX_ERR(17, 14, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyUnicode_Type), 1, "name", 1))) __PYX_ERR(17, 16, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(17, 17, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_protocol), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, 1, "protocol", 0))) __PYX_ERR(17, 18, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_class), (&PyType_Type), 1, "record_class", 1))) __PYX_ERR(17, 19, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self), __pyx_v_name, __pyx_v_query, __pyx_v_protocol, __pyx_v_record_class, __pyx_v_ignore_custom_codec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState___cinit__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_protocol, PyTypeObject *__pyx_v_record_class, int __pyx_v_ignore_custom_codec) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":22
 *         bint ignore_custom_codec
 *     ):
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.query = query
 *         self.settings = protocol.settings
*/
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "asyncpg/protocol/prepared_stmt.pyx":23
 *     ):
 *         self.name = name
 *         self.query = query             # <<<<<<<<<<<<<<
 *         self.settings = protocol.settings
 *         self.row_desc = self.parameters_desc = None
*/
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  __Pyx_GOTREF(__pyx_v_self->query);
  __Pyx_DECREF(__pyx_v_self->query);
  __pyx_v_self->query = __pyx_v_query;

  /* "asyncpg/protocol/prepared_stmt.pyx":24
 *         self.name = name
 *         self.query = query
 *         self.settings = protocol.settings             # <<<<<<<<<<<<<<
 *         self.row_desc = self.parameters_desc = None
 *         self.args_codecs = self.rows_codecs = None
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_protocol->settings);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->settings);
  __Pyx_DECREF((PyObject *)__pyx_v_self->settings);
  __pyx_v_self->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":25
 *         self.query = query
 *         self.settings = protocol.settings
 *         self.row_desc = self.parameters_desc = None             # <<<<<<<<<<<<<<
 *         self.args_codecs = self.rows_codecs = None
 *         self.args_num = self.cols_num = 0
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->row_desc);
  __Pyx_DECREF(__pyx_v_self->row_desc);
  __pyx_v_self->row_desc = ((PyObject*)Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parameters_desc);
  __Pyx_DECREF(__pyx_v_self->parameters_desc);
  __pyx_v_self->parameters_desc = ((PyObject*)Py_None);

  /* "asyncpg/protocol/prepared_stmt.pyx":26
 *         self.settings = protocol.settings
 *         self.row_desc = self.parameters_desc = None
 *         self.args_codecs = self.rows_codecs = None             # <<<<<<<<<<<<<<
 *         self.args_num = self.cols_num = 0
 *         self.cols_desc = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args_codecs);
  __Pyx_DECREF(__pyx_v_self->args_codecs);
  __pyx_v_self->args_codecs = ((PyObject*)Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rows_codecs);
  __Pyx_DECREF(__pyx_v_self->rows_codecs);
  __pyx_v_self->rows_codecs = ((PyObject*)Py_None);

  /* "asyncpg/protocol/prepared_stmt.pyx":27
 *         self.row_desc = self.parameters_desc = None
 *         self.args_codecs = self.rows_codecs = None
 *         self.args_num = self.cols_num = 0             # <<<<<<<<<<<<<<
 *         self.cols_desc = None
 *         self.closed = False
*/
  __pyx_v_self->args_num = 0;
  __pyx_v_self->cols_num = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":28
 *         self.args_codecs = self.rows_codecs = None
 *         self.args_num = self.cols_num = 0
 *         self.cols_desc = None             # <<<<<<<<<<<<<<
 *         self.closed = False
 *         self.prepared = True
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cols_desc);
  __Pyx_DECREF(__pyx_v_self->cols_desc);
  __pyx_v_self->cols_desc = Py_None;

  /* "asyncpg/protocol/prepared_stmt.pyx":29
 *         self.args_num = self.cols_num = 0
 *         self.cols_desc = None
 *         self.closed = False             # <<<<<<<<<<<<<<
 *         self.prepared = True
 *         self.refs = 0
*/
  __pyx_v_self->closed = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":30
 *         self.cols_desc = None
 *         self.closed = False
 *         self.prepared = True             # <<<<<<<<<<<<<<
 *         self.refs = 0
 *         self.record_class = record_class
*/
  __pyx_v_self->prepared = 1;

  /* "asyncpg/protocol/prepared_stmt.pyx":31
 *         self.closed = False
 *         self.prepared = True
 *         self.refs = 0             # <<<<<<<<<<<<<<
 *         self.record_class = record_class
 *         self.ignore_custom_codec = ignore_custom_codec
*/
  __pyx_v_self->refs = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":32
 *         self.prepared = True
 *         self.refs = 0
 *         self.record_class = record_class             # <<<<<<<<<<<<<<
 *         self.ignore_custom_codec = ignore_custom_codec
 * 
*/
  __Pyx_INCREF((PyObject *)__pyx_v_record_class);
  __Pyx_GIVEREF((PyObject *)__pyx_v_record_class);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->record_class);
  __Pyx_DECREF((PyObject *)__pyx_v_self->record_class);
  __pyx_v_self->record_class = __pyx_v_record_class;

  /* "asyncpg/protocol/prepared_stmt.pyx":33
 *         self.refs = 0
 *         self.record_class = record_class
 *         self.ignore_custom_codec = ignore_custom_codec             # <<<<<<<<<<<<<<
 * 
 *     def _get_parameters(self):
*/
  __pyx_v_self->ignore_custom_codec = __pyx_v_ignore_custom_codec;

  /* "asyncpg/protocol/prepared_stmt.pyx":14
 * cdef class PreparedStatementState:
 * 
 *     def __cinit__(             # <<<<<<<<<<<<<<
 *         self,
 *         str name,
*/

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

/* "asyncpg/protocol/prepared_stmt.pyx":35
 *         self.ignore_custom_codec = ignore_custom_codec
 * 
 *     def _get_parameters(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters = {"_get_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_parameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_parameters", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_parameters", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_2_get_parameters(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  uint32_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_parameters", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":38
 *         cdef Codec codec
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         for oid in self.parameters_desc:
 *             codec = self.settings.get_data_codec(oid)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":39
 * 
 *         result = []
 *         for oid in self.parameters_desc:             # <<<<<<<<<<<<<<
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:
*/
  if (unlikely(__pyx_v_self->parameters_desc == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(17, 39, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 39, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":40
 *         result = []
 *         for oid in self.parameters_desc:
 *             codec = self.settings.get_data_codec(oid)             # <<<<<<<<<<<<<<
 *             if codec is None:
 *                 raise exceptions.InternalClientError(
*/
    __pyx_t_4 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 40, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, __pyx_t_4, 0, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":41
 *         for oid in self.parameters_desc:
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
*/
    __pyx_t_5 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (unlikely(__pyx_t_5)) {

      /* "asyncpg/protocol/prepared_stmt.pyx":42
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'missing codec information for OID {}'.format(oid))
 *             result.append(apg_types.Type(
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":43
 *             if codec is None:
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))             # <<<<<<<<<<<<<<
 *             result.append(apg_types.Type(
 *                 oid, codec.name, codec.kind, codec.schema))
*/
      __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_missing_codec_information_for_OI;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_oid};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 43, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 42, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(17, 42, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":41
 *         for oid in self.parameters_desc:
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":44
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
 *             result.append(apg_types.Type(             # <<<<<<<<<<<<<<
 *                 oid, codec.name, codec.kind, codec.schema))
 * 
*/
    __pyx_t_8 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":45
 *                     'missing codec information for OID {}'.format(oid))
 *             result.append(apg_types.Type(
 *                 oid, codec.name, codec.kind, codec.schema))             # <<<<<<<<<<<<<<
 * 
 *         return tuple(result)
*/
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_8);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":44
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
 *             result.append(apg_types.Type(             # <<<<<<<<<<<<<<
 *                 oid, codec.name, codec.kind, codec.schema))
 * 
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(17, 44, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":39
 * 
 *         result = []
 *         for oid in self.parameters_desc:             # <<<<<<<<<<<<<<
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":47
 *                 oid, codec.name, codec.kind, codec.schema))
 * 
 *         return tuple(result)             # <<<<<<<<<<<<<<
 * 
 *     def _get_attributes(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":35
 *         self.ignore_custom_codec = ignore_custom_codec
 * 
 *     def _get_parameters(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._get_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":49
 *         return tuple(result)
 * 
 *     def _get_attributes(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes = {"_get_attributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_attributes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_attributes", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_attributes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4_get_attributes(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_oid = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  uint32_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_attributes", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":52
 *         cdef Codec codec
 * 
 *         if not self.row_desc:             # <<<<<<<<<<<<<<
 *             return ()
 * 
*/
  if (__pyx_v_self->row_desc == Py_None) __pyx_t_1 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->row_desc);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 52, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/prepared_stmt.pyx":53
 * 
 *         if not self.row_desc:
 *             return ()             # <<<<<<<<<<<<<<
 * 
 *         result = []
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;

    /* "asyncpg/protocol/prepared_stmt.pyx":52
 *         cdef Codec codec
 * 
 *         if not self.row_desc:             # <<<<<<<<<<<<<<
 *             return ()
 * 
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":55
 *             return ()
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         for d in self.row_desc:
 *             name = d[0]
*/
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":56
 * 
 *         result = []
 *         for d in self.row_desc:             # <<<<<<<<<<<<<<
 *             name = d[0]
 *             oid = d[3]
*/
  if (unlikely(__pyx_v_self->row_desc == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(17, 56, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 56, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":57
 *         result = []
 *         for d in self.row_desc:
 *             name = d[0]             # <<<<<<<<<<<<<<
 *             oid = d[3]
 * 
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":58
 *         for d in self.row_desc:
 *             name = d[0]
 *             oid = d[3]             # <<<<<<<<<<<<<<
 * 
 *             codec = self.settings.get_data_codec(oid)
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_d, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_oid, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":60
 *             oid = d[3]
 * 
 *             codec = self.settings.get_data_codec(oid)             # <<<<<<<<<<<<<<
 *             if codec is None:
 *                 raise exceptions.InternalClientError(
*/
    __pyx_t_6 = __Pyx_PyLong_As_uint32_t(__pyx_v_oid); if (unlikely((__pyx_t_6 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 60, __pyx_L1_error)
    __pyx_t_5 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, __pyx_t_6, 0, NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":61
 * 
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
*/
    __pyx_t_2 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/prepared_stmt.pyx":62
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'missing codec information for OID {}'.format(oid))
 * 
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":63
 *             if codec is None:
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))             # <<<<<<<<<<<<<<
 * 
 *             name = name.decode(self.settings._encoding)
*/
      __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u_missing_codec_information_for_OI;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_oid};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 63, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_11 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
        __pyx_t_11 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 62, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(17, 62, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":61
 * 
 *             codec = self.settings.get_data_codec(oid)
 *             if codec is None:             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'missing codec information for OID {}'.format(oid))
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":65
 *                     'missing codec information for OID {}'.format(oid))
 * 
 *             name = name.decode(self.settings._encoding)             # <<<<<<<<<<<<<<
 * 
 *             result.append(
*/
    __pyx_t_9 = __pyx_v_name;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_t_11 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_self->settings->_encoding};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":68
 * 
 *             result.append(
 *                 apg_types.Attribute(name,             # <<<<<<<<<<<<<<
 *                     apg_types.Type(oid, codec.name, codec.kind, codec.schema)))
 * 
*/
    __pyx_t_9 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Attribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":69
 *             result.append(
 *                 apg_types.Attribute(name,
 *                     apg_types.Type(oid, codec.name, codec.kind, codec.schema)))             # <<<<<<<<<<<<<<
 * 
 *         return tuple(result)
*/
    __pyx_t_10 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_apg_types); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
      assert(__pyx_t_10);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_10, __pyx_v_oid, __pyx_v_codec->name, __pyx_v_codec->kind, __pyx_v_codec->schema};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_11, (5-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 69, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_t_11 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_9);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_11 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_name, __pyx_t_8};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 68, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":67
 *             name = name.decode(self.settings._encoding)
 * 
 *             result.append(             # <<<<<<<<<<<<<<
 *                 apg_types.Attribute(name,
 *                     apg_types.Type(oid, codec.name, codec.kind, codec.schema)))
*/
    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(17, 67, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":56
 * 
 *         result = []
 *         for d in self.row_desc:             # <<<<<<<<<<<<<<
 *             name = d[0]
 *             oid = d[3]
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":71
 *                     apg_types.Type(oid, codec.name, codec.kind, codec.schema)))
 * 
 *         return tuple(result)             # <<<<<<<<<<<<<<
 * 
 *     def _init_types(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":49
 *         return tuple(result)
 * 
 *     def _get_attributes(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._get_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_oid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":73
 *         return tuple(result)
 * 
 *     def _init_types(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types = {"_init_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_types (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_init_types", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_init_types", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6_init_types(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_missing = 0;
  PyObject *__pyx_v_p_oid = NULL;
  PyObject *__pyx_v_rdesc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  uint32_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_types", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":76
 *         cdef:
 *             Codec codec
 *             set missing = set()             # <<<<<<<<<<<<<<
 * 
 *         if self.parameters_desc:
*/
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_missing = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":78
 *             set missing = set()
 * 
 *         if self.parameters_desc:             # <<<<<<<<<<<<<<
 *             for p_oid in self.parameters_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
*/
  if (__pyx_v_self->parameters_desc == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->parameters_desc);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 78, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {

    /* "asyncpg/protocol/prepared_stmt.pyx":79
 * 
 *         if self.parameters_desc:
 *             for p_oid in self.parameters_desc:             # <<<<<<<<<<<<<<
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
 *                 if codec is None or not codec.has_encoder():
*/
    if (unlikely(__pyx_v_self->parameters_desc == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(17, 79, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->parameters_desc; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 79, __pyx_L1_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_p_oid, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":80
 *         if self.parameters_desc:
 *             for p_oid in self.parameters_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)             # <<<<<<<<<<<<<<
 *                 if codec is None or not codec.has_encoder():
 *                     missing.add(p_oid)
*/
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_v_p_oid); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 80, __pyx_L1_error)
      __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_t_5), 0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 80, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":81
 *             for p_oid in self.parameters_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
 *                 if codec is None or not codec.has_encoder():             # <<<<<<<<<<<<<<
 *                     missing.add(p_oid)
 * 
*/
      __pyx_t_6 = (((PyObject *)__pyx_v_codec) == Py_None);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_2 = __pyx_t_6;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 81, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(17, 81, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = (!__pyx_t_6);
      __pyx_t_2 = __pyx_t_7;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_2) {

        /* "asyncpg/protocol/prepared_stmt.pyx":82
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
 *                 if codec is None or not codec.has_encoder():
 *                     missing.add(p_oid)             # <<<<<<<<<<<<<<
 * 
 *         if self.row_desc:
*/
        __pyx_t_8 = PySet_Add(__pyx_v_missing, __pyx_v_p_oid); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 82, __pyx_L1_error)

        /* "asyncpg/protocol/prepared_stmt.pyx":81
 *             for p_oid in self.parameters_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
 *                 if codec is None or not codec.has_encoder():             # <<<<<<<<<<<<<<
 *                     missing.add(p_oid)
 * 
*/
      }

      /* "asyncpg/protocol/prepared_stmt.pyx":79
 * 
 *         if self.parameters_desc:
 *             for p_oid in self.parameters_desc:             # <<<<<<<<<<<<<<
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
 *                 if codec is None or not codec.has_encoder():
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":78
 *             set missing = set()
 * 
 *         if self.parameters_desc:             # <<<<<<<<<<<<<<
 *             for p_oid in self.parameters_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>p_oid)
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":84
 *                     missing.add(p_oid)
 * 
 *         if self.row_desc:             # <<<<<<<<<<<<<<
 *             for rdesc in self.row_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
*/
  if (__pyx_v_self->row_desc == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_self->row_desc);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 84, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {

    /* "asyncpg/protocol/prepared_stmt.pyx":85
 * 
 *         if self.row_desc:
 *             for rdesc in self.row_desc:             # <<<<<<<<<<<<<<
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
 *                 if codec is None or not codec.has_decoder():
*/
    if (unlikely(__pyx_v_self->row_desc == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(17, 85, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->row_desc; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(17, 85, __pyx_L1_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_rdesc, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":86
 *         if self.row_desc:
 *             for rdesc in self.row_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))             # <<<<<<<<<<<<<<
 *                 if codec is None or not codec.has_decoder():
 *                     missing.add(rdesc[3])
*/
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 86, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = ((PyObject *)__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec(__pyx_v_self->settings, ((uint32_t)__pyx_t_5), 0, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":87
 *             for rdesc in self.row_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
 *                 if codec is None or not codec.has_decoder():             # <<<<<<<<<<<<<<
 *                     missing.add(rdesc[3])
 * 
*/
      __pyx_t_7 = (((PyObject *)__pyx_v_codec) == Py_None);
      if (!__pyx_t_7) {
      } else {
        __pyx_t_2 = __pyx_t_7;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(17, 87, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = (!__pyx_t_7);
      __pyx_t_2 = __pyx_t_6;
      __pyx_L14_bool_binop_done:;
      if (__pyx_t_2) {

        /* "asyncpg/protocol/prepared_stmt.pyx":88
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
 *                 if codec is None or not codec.has_decoder():
 *                     missing.add(rdesc[3])             # <<<<<<<<<<<<<<
 * 
 *         return missing
*/
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_rdesc, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PySet_Add(__pyx_v_missing, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 88, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "asyncpg/protocol/prepared_stmt.pyx":87
 *             for rdesc in self.row_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
 *                 if codec is None or not codec.has_decoder():             # <<<<<<<<<<<<<<
 *                     missing.add(rdesc[3])
 * 
*/
      }

      /* "asyncpg/protocol/prepared_stmt.pyx":85
 * 
 *         if self.row_desc:
 *             for rdesc in self.row_desc:             # <<<<<<<<<<<<<<
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
 *                 if codec is None or not codec.has_decoder():
*/
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":84
 *                     missing.add(p_oid)
 * 
 *         if self.row_desc:             # <<<<<<<<<<<<<<
 *             for rdesc in self.row_desc:
 *                 codec = self.settings.get_data_codec(<uint32_t>(rdesc[3]))
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":90
 *                     missing.add(rdesc[3])
 * 
 *         return missing             # <<<<<<<<<<<<<<
 * 
 *     cpdef _init_codecs(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_missing);
  __pyx_r = __pyx_v_missing;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":73
 *         return tuple(result)
 * 
 *     def _init_types(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_missing);
  __Pyx_XDECREF(__pyx_v_p_oid);
  __Pyx_XDECREF(__pyx_v_rdesc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":92
 *         return missing
 * 
 *     cpdef _init_codecs(self):             # <<<<<<<<<<<<<<
 *         self._ensure_args_encoder()
 *         self._ensure_rows_decoder()
*/

static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_codecs", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":93
 * 
 *     cpdef _init_codecs(self):
 *         self._ensure_args_encoder()             # <<<<<<<<<<<<<<
 *         self._ensure_rows_decoder()
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":94
 *     cpdef _init_codecs(self):
 *         self._ensure_args_encoder()
 *         self._ensure_rows_decoder()             # <<<<<<<<<<<<<<
 * 
 *     def attach(self):
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":92
 *         return missing
 * 
 *     cpdef _init_codecs(self):             # <<<<<<<<<<<<<<
 *         self._ensure_args_encoder()
 *         self._ensure_rows_decoder()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs = {"_init_codecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_codecs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_init_codecs", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_init_codecs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8_init_codecs(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_codecs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._init_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":96
 *         self._ensure_rows_decoder()
 * 
 *     def attach(self):             # <<<<<<<<<<<<<<
 *         self.refs += 1
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach = {"attach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("attach (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("attach", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("attach", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_10attach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("attach", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":97
 * 
 *     def attach(self):
 *         self.refs += 1             # <<<<<<<<<<<<<<
 * 
 *     def detach(self):
*/
  __pyx_v_self->refs = (__pyx_v_self->refs + 1);

  /* "asyncpg/protocol/prepared_stmt.pyx":96
 *         self._ensure_rows_decoder()
 * 
 *     def attach(self):             # <<<<<<<<<<<<<<
 *         self.refs += 1
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":99
 *         self.refs += 1
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         self.refs -= 1
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach = {"detach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("detach", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("detach", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12detach(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("detach", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":100
 * 
 *     def detach(self):
 *         self.refs -= 1             # <<<<<<<<<<<<<<
 * 
 *     def mark_closed(self):
*/
  __pyx_v_self->refs = (__pyx_v_self->refs - 1);

  /* "asyncpg/protocol/prepared_stmt.pyx":99
 *         self.refs += 1
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         self.refs -= 1
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":102
 *         self.refs -= 1
 * 
 *     def mark_closed(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed = {"mark_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mark_closed (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mark_closed", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mark_closed", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_14mark_closed(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mark_closed", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":103
 * 
 *     def mark_closed(self):
 *         self.closed = True             # <<<<<<<<<<<<<<
 * 
 *     def mark_unprepared(self):
*/
  __pyx_v_self->closed = 1;

  /* "asyncpg/protocol/prepared_stmt.pyx":102
 *         self.refs -= 1
 * 
 *     def mark_closed(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":105
 *         self.closed = True
 * 
 *     def mark_unprepared(self):             # <<<<<<<<<<<<<<
 *         if self.name:
 *             raise exceptions.InternalClientError(
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared = {"mark_unprepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mark_unprepared (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mark_unprepared", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mark_unprepared", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_16mark_unprepared(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mark_unprepared", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":106
 * 
 *     def mark_unprepared(self):
 *         if self.name:             # <<<<<<<<<<<<<<
 *             raise exceptions.InternalClientError(
 *                 "named prepared statements cannot be marked unprepared")
*/
  if (__pyx_v_self->name == Py_None) __pyx_t_1 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyUnicode_IS_TRUE(__pyx_v_self->name);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(17, 106, __pyx_L1_error)
    __pyx_t_1 = (__pyx_temp != 0);
  }

  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/prepared_stmt.pyx":107
 *     def mark_unprepared(self):
 *         if self.name:
 *             raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                 "named prepared statements cannot be marked unprepared")
 *         self.prepared = False
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_named_prepared_statements_cannot};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(17, 107, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":106
 * 
 *     def mark_unprepared(self):
 *         if self.name:             # <<<<<<<<<<<<<<
 *             raise exceptions.InternalClientError(
 *                 "named prepared statements cannot be marked unprepared")
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":109
 *             raise exceptions.InternalClientError(
 *                 "named prepared statements cannot be marked unprepared")
 *         self.prepared = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _encode_bind_msg(self, args, int seqno = -1):
*/
  __pyx_v_self->prepared = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":105
 *         self.closed = True
 * 
 *     def mark_unprepared(self):             # <<<<<<<<<<<<<<
 *         if self.name:
 *             raise exceptions.InternalClientError(
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.mark_unprepared", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":111
 *         self.prepared = False
 * 
 *     cdef _encode_bind_msg(self, args, int seqno = -1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int idx
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_args, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args) {
  int __pyx_v_seqno = ((int)-1);
  int __pyx_v_idx;
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_writer = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  Py_ssize_t __pyx_v_num_args_passed;
  PyObject *__pyx_v_hint = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_value_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int16_t __pyx_t_15;
  int16_t __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_t_22;
  char const *__pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30[7];
  char const *__pyx_t_31;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_encode_bind_msg", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_seqno = __pyx_optional_args->seqno;
    }
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":117
 *             Codec codec
 * 
 *         if not cpython.PySequence_Check(args):             # <<<<<<<<<<<<<<
 *             if seqno >= 0:
 *                 raise exceptions.DataError(
*/
  __pyx_t_1 = (!PySequence_Check(__pyx_v_args));
  if (__pyx_t_1) {

    /* "asyncpg/protocol/prepared_stmt.pyx":118
 * 
 *         if not cpython.PySequence_Check(args):
 *             if seqno >= 0:             # <<<<<<<<<<<<<<
 *                 raise exceptions.DataError(
 *                     f'invalid input in executemany() argument sequence '
*/
    __pyx_t_1 = (__pyx_v_seqno >= 0);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/prepared_stmt.pyx":119
 *         if not cpython.PySequence_Check(args):
 *             if seqno >= 0:
 *                 raise exceptions.DataError(             # <<<<<<<<<<<<<<
 *                     f'invalid input in executemany() argument sequence '
 *                     f'element #{seqno}: expected a sequence, got '
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DataError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":121
 *                 raise exceptions.DataError(
 *                     f'invalid input in executemany() argument sequence '
 *                     f'element #{seqno}: expected a sequence, got '             # <<<<<<<<<<<<<<
 *                     f'{type(args).__name__}'
 *                 )
*/
      __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "asyncpg/protocol/prepared_stmt.pyx":122
 *                     f'invalid input in executemany() argument sequence '
 *                     f'element #{seqno}: expected a sequence, got '
 *                     f'{type(args).__name__}'             # <<<<<<<<<<<<<<
 *                 )
 *             else:
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_invalid_input_in_executemany_arg;
      __pyx_t_8[1] = __pyx_t_4;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected_a_sequence_got;
      __pyx_t_8[3] = __pyx_t_7;

      /* "asyncpg/protocol/prepared_stmt.pyx":120
 *             if seqno >= 0:
 *                 raise exceptions.DataError(
 *                     f'invalid input in executemany() argument sequence '             # <<<<<<<<<<<<<<
 *                     f'element #{seqno}: expected a sequence, got '
 *                     f'{type(args).__name__}'
*/
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 58 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
      if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 120, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 119, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(17, 119, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":118
 * 
 *         if not cpython.PySequence_Check(args):
 *             if seqno >= 0:             # <<<<<<<<<<<<<<
 *                 raise exceptions.DataError(
 *                     f'invalid input in executemany() argument sequence '
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":127
 *                 # Non executemany() callers do not pass user input directly,
 *                 # so bad input is a bug.
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     f'Bind: expected a sequence, got {type(args).__name__}')
 * 
*/
    /*else*/ {
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":128
 *                 # so bad input is a bug.
 *                 raise exceptions.InternalClientError(
 *                     f'Bind: expected a sequence, got {type(args).__name__}')             # <<<<<<<<<<<<<<
 * 
 *         if len(args) > 32767:
*/
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_args)), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Bind_expected_a_sequence_got, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(17, 127, __pyx_L1_error)
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":117
 *             Codec codec
 * 
 *         if not cpython.PySequence_Check(args):             # <<<<<<<<<<<<<<
 *             if seqno >= 0:
 *                 raise exceptions.DataError(
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":130
 *                     f'Bind: expected a sequence, got {type(args).__name__}')
 * 
 *         if len(args) > 32767:             # <<<<<<<<<<<<<<
 *             raise exceptions.InterfaceError(
 *                 'the number of query arguments cannot exceed 32767')
*/
  __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 130, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_10 > 0x7FFF);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/prepared_stmt.pyx":131
 * 
 *         if len(args) > 32767:
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'the number of query arguments cannot exceed 32767')
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_the_number_of_query_arguments_ca};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(17, 131, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":130
 *                     f'Bind: expected a sequence, got {type(args).__name__}')
 * 
 *         if len(args) > 32767:             # <<<<<<<<<<<<<<
 *             raise exceptions.InterfaceError(
 *                 'the number of query arguments cannot exceed 32767')
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":134
 *                 'the number of query arguments cannot exceed 32767')
 * 
 *         writer = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *         num_args_passed = len(args)
*/
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_writer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":136
 *         writer = WriteBuffer.new()
 * 
 *         num_args_passed = len(args)             # <<<<<<<<<<<<<<
 *         if self.args_num != num_args_passed:
 *             hint = 'Check the query against the passed list of arguments.'
*/
  __pyx_t_10 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 136, __pyx_L1_error)
  __pyx_v_num_args_passed = __pyx_t_10;

  /* "asyncpg/protocol/prepared_stmt.pyx":137
 * 
 *         num_args_passed = len(args)
 *         if self.args_num != num_args_passed:             # <<<<<<<<<<<<<<
 *             hint = 'Check the query against the passed list of arguments.'
 * 
*/
  __pyx_t_1 = (__pyx_v_self->args_num != __pyx_v_num_args_passed);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/prepared_stmt.pyx":138
 *         num_args_passed = len(args)
 *         if self.args_num != num_args_passed:
 *             hint = 'Check the query against the passed list of arguments.'             # <<<<<<<<<<<<<<
 * 
 *             if self.args_num == 0:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Check_the_query_against_the_pass);
    __pyx_v_hint = __pyx_mstate_global->__pyx_kp_u_Check_the_query_against_the_pass;

    /* "asyncpg/protocol/prepared_stmt.pyx":140
 *             hint = 'Check the query against the passed list of arguments.'
 * 
 *             if self.args_num == 0:             # <<<<<<<<<<<<<<
 *                 # If the server was expecting zero arguments, it is likely
 *                 # that the user tried to parametrize a statement that does
*/
    __pyx_t_1 = (__pyx_v_self->args_num == 0);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/prepared_stmt.pyx":144
 *                 # that the user tried to parametrize a statement that does
 *                 # not support parameters.
 *                 hint += (r'  Note that parameters are supported only in'             # <<<<<<<<<<<<<<
 *                          r' SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES'
 *                          r' statements, and will *not* work in statements '
*/
      __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_v_hint, __pyx_mstate_global->__pyx_kp_u_Note_that_parameters_are_suppor); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_hint, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":140
 *             hint = 'Check the query against the passed list of arguments.'
 * 
 *             if self.args_num == 0:             # <<<<<<<<<<<<<<
 *                 # If the server was expecting zero arguments, it is likely
 *                 # that the user tried to parametrize a statement that does
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":149
 *                          r' like CREATE VIEW or DECLARE CURSOR.')
 * 
 *             raise exceptions.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'the server expects {x} argument{s} for this query, '
 *                 '{y} {w} passed'.format(
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":151
 *             raise exceptions.InterfaceError(
 *                 'the server expects {x} argument{s} for this query, '
 *                 '{y} {w} passed'.format(             # <<<<<<<<<<<<<<
 *                     x=self.args_num, s='s' if self.args_num != 1 else '',
 *                     y=num_args_passed,
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_the_server_expects_x_argument_s;
    __Pyx_INCREF(__pyx_t_7);

    /* "asyncpg/protocol/prepared_stmt.pyx":152
 *                 'the server expects {x} argument{s} for this query, '
 *                 '{y} {w} passed'.format(
 *                     x=self.args_num, s='s' if self.args_num != 1 else '',             # <<<<<<<<<<<<<<
 *                     y=num_args_passed,
 *                     w='was' if num_args_passed == 1 else 'were'),
*/
    __pyx_t_4 = __Pyx_PyLong_From_int16_t(__pyx_v_self->args_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = (__pyx_v_self->args_num != 1);
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_s_2);
      __pyx_t_11 = __pyx_mstate_global->__pyx_n_u_s_2;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15);
      __pyx_t_11 = __pyx_mstate_global->__pyx_kp_u__15;
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":153
 *                 '{y} {w} passed'.format(
 *                     x=self.args_num, s='s' if self.args_num != 1 else '',
 *                     y=num_args_passed,             # <<<<<<<<<<<<<<
 *                     w='was' if num_args_passed == 1 else 'were'),
 *                 hint=hint)
*/
    __pyx_t_12 = PyLong_FromSsize_t(__pyx_v_num_args_passed); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);

    /* "asyncpg/protocol/prepared_stmt.pyx":154
 *                     x=self.args_num, s='s' if self.args_num != 1 else '',
 *                     y=num_args_passed,
 *                     w='was' if num_args_passed == 1 else 'were'),             # <<<<<<<<<<<<<<
 *                 hint=hint)
 * 
*/
    __pyx_t_1 = (__pyx_v_num_args_passed == 1);
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_was);
      __pyx_t_13 = __pyx_mstate_global->__pyx_n_u_was;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_were);
      __pyx_t_13 = __pyx_mstate_global->__pyx_n_u_were;
    }
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 4 : 0)] = {__pyx_t_7, NULL};
      __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_x, __pyx_t_4, __pyx_t_14, __pyx_callargs+1, 0) < (0)) __PYX_ERR(17, 151, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_s_2, __pyx_t_11, __pyx_t_14, __pyx_callargs+1, 1) < (0)) __PYX_ERR(17, 151, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_y, __pyx_t_12, __pyx_t_14, __pyx_callargs+1, 2) < (0)) __PYX_ERR(17, 151, __pyx_L1_error)
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_w, __pyx_t_13, __pyx_t_14, __pyx_callargs+1, 3) < (0)) __PYX_ERR(17, 151, __pyx_L1_error)
      __pyx_t_3 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":155
 *                     y=num_args_passed,
 *                     w='was' if num_args_passed == 1 else 'were'),
 *                 hint=hint)             # <<<<<<<<<<<<<<
 * 
 *         if self.have_text_args:
*/
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_14 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_hint, __pyx_v_hint, __pyx_t_14, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 149, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(17, 149, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":137
 * 
 *         num_args_passed = len(args)
 *         if self.args_num != num_args_passed:             # <<<<<<<<<<<<<<
 *             hint = 'Check the query against the passed list of arguments.'
 * 
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":157
 *                 hint=hint)
 * 
 *         if self.have_text_args:             # <<<<<<<<<<<<<<
 *             writer.write_int16(self.args_num)
 *             for idx in range(self.args_num):
*/
  if (__pyx_v_self->have_text_args) {

    /* "asyncpg/protocol/prepared_stmt.pyx":158
 * 
 *         if self.have_text_args:
 *             writer.write_int16(self.args_num)             # <<<<<<<<<<<<<<
 *             for idx in range(self.args_num):
 *                 codec = <Codec>(self.args_codecs[idx])
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":159
 *         if self.have_text_args:
 *             writer.write_int16(self.args_num)
 *             for idx in range(self.args_num):             # <<<<<<<<<<<<<<
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 writer.write_int16(<int16_t>codec.format)
*/
    __pyx_t_15 = __pyx_v_self->args_num;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idx = __pyx_t_17;

      /* "asyncpg/protocol/prepared_stmt.pyx":160
 *             writer.write_int16(self.args_num)
 *             for idx in range(self.args_num):
 *                 codec = <Codec>(self.args_codecs[idx])             # <<<<<<<<<<<<<<
 *                 writer.write_int16(<int16_t>codec.format)
 *         else:
*/
      if (unlikely(__pyx_v_self->args_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(17, 160, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":161
 *             for idx in range(self.args_num):
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 writer.write_int16(<int16_t>codec.format)             # <<<<<<<<<<<<<<
 *         else:
 *             # All arguments are in binary format
*/
      __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, ((int16_t)__pyx_v_codec->format)); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":157
 *                 hint=hint)
 * 
 *         if self.have_text_args:             # <<<<<<<<<<<<<<
 *             writer.write_int16(self.args_num)
 *             for idx in range(self.args_num):
*/
    goto __pyx_L8;
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":164
 *         else:
 *             # All arguments are in binary format
 *             writer.write_int32(0x00010001)             # <<<<<<<<<<<<<<
 * 
 *         writer.write_int16(self.args_num)
*/
  /*else*/ {
    __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L8:;

  /* "asyncpg/protocol/prepared_stmt.pyx":166
 *             writer.write_int32(0x00010001)
 * 
 *         writer.write_int16(self.args_num)             # <<<<<<<<<<<<<<
 * 
 *         for idx in range(self.args_num):
*/
  __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->args_num); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":168
 *         writer.write_int16(self.args_num)
 * 
 *         for idx in range(self.args_num):             # <<<<<<<<<<<<<<
 *             arg = args[idx]
 *             if arg is None:
*/
  __pyx_t_15 = __pyx_v_self->args_num;
  __pyx_t_16 = __pyx_t_15;
  for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
    __pyx_v_idx = __pyx_t_17;

    /* "asyncpg/protocol/prepared_stmt.pyx":169
 * 
 *         for idx in range(self.args_num):
 *             arg = args[idx]             # <<<<<<<<<<<<<<
 *             if arg is None:
 *                 writer.write_int32(-1)
*/
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":170
 *         for idx in range(self.args_num):
 *             arg = args[idx]
 *             if arg is None:             # <<<<<<<<<<<<<<
 *                 writer.write_int32(-1)
 *             else:
*/
    __pyx_t_1 = (__pyx_v_arg == Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/prepared_stmt.pyx":171
 *             arg = args[idx]
 *             if arg is None:
 *                 writer.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 codec = <Codec>(self.args_codecs[idx])
*/
      __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, -1); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":170
 *         for idx in range(self.args_num):
 *             arg = args[idx]
 *             if arg is None:             # <<<<<<<<<<<<<<
 *                 writer.write_int32(-1)
 *             else:
*/
      goto __pyx_L13;
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":173
 *                 writer.write_int32(-1)
 *             else:
 *                 codec = <Codec>(self.args_codecs[idx])             # <<<<<<<<<<<<<<
 *                 try:
 *                     codec.encode(self.settings, writer, arg)
*/
    /*else*/ {
      if (unlikely(__pyx_v_self->args_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(17, 173, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_self->args_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":174
 *             else:
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 try:             # <<<<<<<<<<<<<<
 *                     codec.encode(self.settings, writer, arg)
 *                 except (AssertionError, exceptions.InternalClientError):
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        /*try:*/ {

          /* "asyncpg/protocol/prepared_stmt.pyx":175
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 try:
 *                     codec.encode(self.settings, writer, arg)             # <<<<<<<<<<<<<<
 *                 except (AssertionError, exceptions.InternalClientError):
 *                     # These are internal errors and should raise as-is.
*/
          __pyx_t_2 = ((PyObject *)__pyx_v_self->settings);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_6 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_2), __pyx_v_writer, __pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 175, __pyx_L14_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "asyncpg/protocol/prepared_stmt.pyx":174
 *             else:
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 try:             # <<<<<<<<<<<<<<
 *                     codec.encode(self.settings, writer, arg)
 *                 except (AssertionError, exceptions.InternalClientError):
*/
        }
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        goto __pyx_L21_try_end;
        __pyx_L14_error:;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/prepared_stmt.pyx":176
 *                 try:
 *                     codec.encode(self.settings, writer, arg)
 *                 except (AssertionError, exceptions.InternalClientError):             # <<<<<<<<<<<<<<
 *                     # These are internal errors and should raise as-is.
 *                     raise
*/
        __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_2, &__pyx_t_14);
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 176, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 176, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_21 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_6, ((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_ErrRestore(__pyx_t_6, __pyx_t_2, __pyx_t_14);
        __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0;
        if (__pyx_t_21) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(17, 176, __pyx_L16_except_error)
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_6);

          /* "asyncpg/protocol/prepared_stmt.pyx":178
 *                 except (AssertionError, exceptions.InternalClientError):
 *                     # These are internal errors and should raise as-is.
 *                     raise             # <<<<<<<<<<<<<<
 *                 except exceptions.InterfaceError as e:
 *                     # This is already a descriptive error, but annotate
*/
          __Pyx_GIVEREF(__pyx_t_14);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_2, __pyx_t_6);
          __pyx_t_14 = 0;  __pyx_t_2 = 0;  __pyx_t_6 = 0; 
          __PYX_ERR(17, 178, __pyx_L16_except_error)
        }

        /* "asyncpg/protocol/prepared_stmt.pyx":179
 *                     # These are internal errors and should raise as-is.
 *                     raise
 *                 except exceptions.InterfaceError as e:             # <<<<<<<<<<<<<<
 *                     # This is already a descriptive error, but annotate
 *                     # with argument name for clarity.
*/
        __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_2, &__pyx_t_14);
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 179, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 179, __pyx_L16_except_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_21 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_ErrRestore(__pyx_t_6, __pyx_t_2, __pyx_t_14);
        __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0;
        if (__pyx_t_21) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_6) < 0) __PYX_ERR(17, 179, __pyx_L16_except_error)
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_v_e = __pyx_t_2;
          /*try:*/ {

            /* "asyncpg/protocol/prepared_stmt.pyx":182
 *                     # This is already a descriptive error, but annotate
 *                     # with argument name for clarity.
 *                     pos = f'${idx + 1}'             # <<<<<<<<<<<<<<
 *                     if seqno >= 0:
 *                         pos = (
*/
            __pyx_t_3 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 182, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__21, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 182, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_v_pos = ((PyObject*)__pyx_t_5);
            __pyx_t_5 = 0;

            /* "asyncpg/protocol/prepared_stmt.pyx":183
 *                     # with argument name for clarity.
 *                     pos = f'${idx + 1}'
 *                     if seqno >= 0:             # <<<<<<<<<<<<<<
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'
*/
            __pyx_t_1 = (__pyx_v_seqno >= 0);
            if (__pyx_t_1) {

              /* "asyncpg/protocol/prepared_stmt.pyx":185
 *                     if seqno >= 0:
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'             # <<<<<<<<<<<<<<
 *                             f' executemany() sequence'
 *                         )
*/
              __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 185, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_8[0] = __pyx_v_pos;
              __pyx_t_8[1] = __pyx_mstate_global->__pyx_kp_u_in_element;
              __pyx_t_8[2] = __pyx_t_5;
              __pyx_t_8[3] = __pyx_mstate_global->__pyx_kp_u_of_executemany_sequence;
              __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 26, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos));
              if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 185, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_3));
              __pyx_t_3 = 0;

              /* "asyncpg/protocol/prepared_stmt.pyx":183
 *                     # with argument name for clarity.
 *                     pos = f'${idx + 1}'
 *                     if seqno >= 0:             # <<<<<<<<<<<<<<
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'
*/
            }

            /* "asyncpg/protocol/prepared_stmt.pyx":188
 *                             f' executemany() sequence'
 *                         )
 *                     raise e.with_msg(             # <<<<<<<<<<<<<<
 *                         f'query argument {pos}: {e.args[0]}'
 *                     ) from None
*/
            __pyx_t_5 = __pyx_v_e;
            __Pyx_INCREF(__pyx_t_5);

            /* "asyncpg/protocol/prepared_stmt.pyx":189
 *                         )
 *                     raise e.with_msg(
 *                         f'query argument {pos}: {e.args[0]}'             # <<<<<<<<<<<<<<
 *                     ) from None
 *                 except Exception as e:
*/
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 189, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 189, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_t_12, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 189, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_query_argument;
            __pyx_t_8[1] = __pyx_v_pos;
            __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u__22;
            __pyx_t_8[3] = __pyx_t_13;
            __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
            if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 189, __pyx_L29_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_9 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_12};
              __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_with_msg, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 188, __pyx_L29_error)
              __Pyx_GOTREF(__pyx_t_3);
            }

            /* "asyncpg/protocol/prepared_stmt.pyx":190
 *                     raise e.with_msg(
 *                         f'query argument {pos}: {e.args[0]}'
 *                     ) from None             # <<<<<<<<<<<<<<
 *                 except Exception as e:
 *                     # Everything else is assumed to be an encoding error
*/
            __Pyx_Raise(__pyx_t_3, 0, 0, Py_None);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(17, 188, __pyx_L29_error)
          }

          /* "asyncpg/protocol/prepared_stmt.pyx":179
 *                     # These are internal errors and should raise as-is.
 *                     raise
 *                 except exceptions.InterfaceError as e:             # <<<<<<<<<<<<<<
 *                     # This is already a descriptive error, but annotate
 *                     # with argument name for clarity.
*/
          /*finally:*/ {
            __pyx_L29_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_27, &__pyx_t_28, &__pyx_t_29);
              if ( unlikely(__Pyx_GetException(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26) < 0)) __Pyx_ErrFetch(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_28);
              __Pyx_XGOTREF(__pyx_t_29);
              __pyx_t_21 = __pyx_lineno; __pyx_t_22 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_27);
              __Pyx_XGIVEREF(__pyx_t_28);
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_ExceptionReset(__pyx_t_27, __pyx_t_28, __pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_ErrRestore(__pyx_t_24, __pyx_t_25, __pyx_t_26);
              __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0; __pyx_t_29 = 0;
              __pyx_lineno = __pyx_t_21; __pyx_clineno = __pyx_t_22; __pyx_filename = __pyx_t_23;
              goto __pyx_L16_except_error;
            }
          }
        }

        /* "asyncpg/protocol/prepared_stmt.pyx":191
 *                         f'query argument {pos}: {e.args[0]}'
 *                     ) from None
 *                 except Exception as e:             # <<<<<<<<<<<<<<
 *                     # Everything else is assumed to be an encoding error
 *                     # due to invalid input.
*/
        __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_22) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_14) < 0) __PYX_ERR(17, 191, __pyx_L16_except_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_v_e = __pyx_t_2;
          /*try:*/ {

            /* "asyncpg/protocol/prepared_stmt.pyx":194
 *                     # Everything else is assumed to be an encoding error
 *                     # due to invalid input.
 *                     pos = f'${idx + 1}'             # <<<<<<<<<<<<<<
 *                     if seqno >= 0:
 *                         pos = (
*/
            __pyx_t_3 = __Pyx_PyUnicode_From_long((__pyx_v_idx + 1), 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 194, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u__21, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 194, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_v_pos = ((PyObject*)__pyx_t_12);
            __pyx_t_12 = 0;

            /* "asyncpg/protocol/prepared_stmt.pyx":195
 *                     # due to invalid input.
 *                     pos = f'${idx + 1}'
 *                     if seqno >= 0:             # <<<<<<<<<<<<<<
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'
*/
            __pyx_t_1 = (__pyx_v_seqno >= 0);
            if (__pyx_t_1) {

              /* "asyncpg/protocol/prepared_stmt.pyx":197
 *                     if seqno >= 0:
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'             # <<<<<<<<<<<<<<
 *                             f' executemany() sequence'
 *                         )
*/
              __pyx_t_12 = __Pyx_PyUnicode_From_int(__pyx_v_seqno, 0, ' ', 'd'); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 197, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_8[0] = __pyx_v_pos;
              __pyx_t_8[1] = __pyx_mstate_global->__pyx_kp_u_in_element;
              __pyx_t_8[2] = __pyx_t_12;
              __pyx_t_8[3] = __pyx_mstate_global->__pyx_kp_u_of_executemany_sequence;
              __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 26, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos));
              if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 197, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF_SET(__pyx_v_pos, ((PyObject*)__pyx_t_3));
              __pyx_t_3 = 0;

              /* "asyncpg/protocol/prepared_stmt.pyx":195
 *                     # due to invalid input.
 *                     pos = f'${idx + 1}'
 *                     if seqno >= 0:             # <<<<<<<<<<<<<<
 *                         pos = (
 *                             f'{pos} in element #{seqno} of'
*/
            }

            /* "asyncpg/protocol/prepared_stmt.pyx":200
 *                             f' executemany() sequence'
 *                         )
 *                     value_repr = repr(arg)             # <<<<<<<<<<<<<<
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
*/
            __pyx_t_3 = PyObject_Repr(__pyx_v_arg); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 200, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_v_value_repr = ((PyObject*)__pyx_t_3);
            __pyx_t_3 = 0;

            /* "asyncpg/protocol/prepared_stmt.pyx":201
 *                         )
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 * 
*/
            if (unlikely(__pyx_v_value_repr == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
              __PYX_ERR(17, 201, __pyx_L41_error)
            }
            __pyx_t_10 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_value_repr); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(17, 201, __pyx_L41_error)
            __pyx_t_1 = (__pyx_t_10 > 40);
            if (__pyx_t_1) {

              /* "asyncpg/protocol/prepared_stmt.pyx":202
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 * 
 *                     raise exceptions.DataError(
*/
              if (unlikely(__pyx_v_value_repr == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                __PYX_ERR(17, 202, __pyx_L41_error)
              }
              __pyx_t_3 = __Pyx_PyUnicode_Substring(__pyx_v_value_repr, 0, 40); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 202, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_12 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__23); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 202, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF_SET(__pyx_v_value_repr, ((PyObject*)__pyx_t_12));
              __pyx_t_12 = 0;

              /* "asyncpg/protocol/prepared_stmt.pyx":201
 *                         )
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 * 
*/
            }

            /* "asyncpg/protocol/prepared_stmt.pyx":204
 *                         value_repr = value_repr[:40] + '...'
 * 
 *                     raise exceptions.DataError(             # <<<<<<<<<<<<<<
 *                         f'invalid input for query argument'
 *                         f' {pos}: {value_repr} ({e})'
*/
            __pyx_t_3 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 204, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DataError); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 204, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "asyncpg/protocol/prepared_stmt.pyx":206
 *                     raise exceptions.DataError(
 *                         f'invalid input for query argument'
 *                         f' {pos}: {value_repr} ({e})'             # <<<<<<<<<<<<<<
 *                     ) from e
 * 
*/
            __pyx_t_5 = __Pyx_PyUnicode_Unicode(__pyx_v_value_repr); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 206, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 206, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_30[0] = __pyx_mstate_global->__pyx_kp_u_invalid_input_for_query_argument;
            __pyx_t_30[1] = __pyx_v_pos;
            __pyx_t_30[2] = __pyx_mstate_global->__pyx_kp_u__22;
            __pyx_t_30[3] = __pyx_t_5;
            __pyx_t_30[4] = __pyx_mstate_global->__pyx_kp_u__24;
            __pyx_t_30[5] = __pyx_t_11;
            __pyx_t_30[6] = __pyx_mstate_global->__pyx_kp_u__6;

            /* "asyncpg/protocol/prepared_stmt.pyx":205
 * 
 *                     raise exceptions.DataError(
 *                         f'invalid input for query argument'             # <<<<<<<<<<<<<<
 *                         f' {pos}: {value_repr} ({e})'
 *                     ) from e
*/
            __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_30, 7, 33 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_pos) + 2 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_pos) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
            if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 205, __pyx_L41_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_9 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
              __pyx_t_9 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
              __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 204, __pyx_L41_error)
              __Pyx_GOTREF(__pyx_t_12);
            }

            /* "asyncpg/protocol/prepared_stmt.pyx":207
 *                         f'invalid input for query argument'
 *                         f' {pos}: {value_repr} ({e})'
 *                     ) from e             # <<<<<<<<<<<<<<
 * 
 *         if self.have_text_cols:
*/
            __Pyx_Raise(__pyx_t_12, 0, 0, __pyx_v_e);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __PYX_ERR(17, 204, __pyx_L41_error)
          }

          /* "asyncpg/protocol/prepared_stmt.pyx":191
 *                         f'query argument {pos}: {e.args[0]}'
 *                     ) from None
 *                 except Exception as e:             # <<<<<<<<<<<<<<
 *                     # Everything else is assumed to be an encoding error
 *                     # due to invalid input.
*/
          /*finally:*/ {
            __pyx_L41_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
              if ( unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_28, &__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_29);
              __Pyx_XGOTREF(__pyx_t_28);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_24);
              __pyx_t_22 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_31 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_26);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_29);
              __Pyx_XGIVEREF(__pyx_t_28);
              __Pyx_XGIVEREF(__pyx_t_27);
              __Pyx_ErrRestore(__pyx_t_29, __pyx_t_28, __pyx_t_27);
              __pyx_t_29 = 0; __pyx_t_28 = 0; __pyx_t_27 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
              __pyx_lineno = __pyx_t_22; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_31;
              goto __pyx_L16_except_error;
            }
          }
        }
        goto __pyx_L16_except_error;

        /* "asyncpg/protocol/prepared_stmt.pyx":174
 *             else:
 *                 codec = <Codec>(self.args_codecs[idx])
 *                 try:             # <<<<<<<<<<<<<<
 *                     codec.encode(self.settings, writer, arg)
 *                 except (AssertionError, exceptions.InternalClientError):
*/
        __pyx_L16_except_error:;
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
        goto __pyx_L1_error;
        __pyx_L21_try_end:;
      }
    }
    __pyx_L13:;
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":209
 *                     ) from e
 * 
 *         if self.have_text_cols:             # <<<<<<<<<<<<<<
 *             writer.write_int16(self.cols_num)
 *             for idx in range(self.cols_num):
*/
  if (__pyx_v_self->have_text_cols) {

    /* "asyncpg/protocol/prepared_stmt.pyx":210
 * 
 *         if self.have_text_cols:
 *             writer.write_int16(self.cols_num)             # <<<<<<<<<<<<<<
 *             for idx in range(self.cols_num):
 *                 codec = <Codec>(self.rows_codecs[idx])
*/
    __pyx_t_14 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, __pyx_v_self->cols_num); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":211
 *         if self.have_text_cols:
 *             writer.write_int16(self.cols_num)
 *             for idx in range(self.cols_num):             # <<<<<<<<<<<<<<
 *                 codec = <Codec>(self.rows_codecs[idx])
 *                 writer.write_int16(<int16_t>codec.format)
*/
    __pyx_t_15 = __pyx_v_self->cols_num;
    __pyx_t_16 = __pyx_t_15;
    for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
      __pyx_v_idx = __pyx_t_17;

      /* "asyncpg/protocol/prepared_stmt.pyx":212
 *             writer.write_int16(self.cols_num)
 *             for idx in range(self.cols_num):
 *                 codec = <Codec>(self.rows_codecs[idx])             # <<<<<<<<<<<<<<
 *                 writer.write_int16(<int16_t>codec.format)
 *         else:
*/
      if (unlikely(__pyx_v_self->rows_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(17, 212, __pyx_L1_error)
      }
      __pyx_t_14 = __Pyx_GetItemInt_Tuple(__pyx_v_self->rows_codecs, __pyx_v_idx, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_14)) __PYX_ERR(17, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_2 = __pyx_t_14;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":213
 *             for idx in range(self.cols_num):
 *                 codec = <Codec>(self.rows_codecs[idx])
 *                 writer.write_int16(<int16_t>codec.format)             # <<<<<<<<<<<<<<
 *         else:
 *             # All columns are in binary format
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int16(__pyx_v_writer, ((int16_t)__pyx_v_codec->format)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":209
 *                     ) from e
 * 
 *         if self.have_text_cols:             # <<<<<<<<<<<<<<
 *             writer.write_int16(self.cols_num)
 *             for idx in range(self.cols_num):
*/
    goto __pyx_L49;
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":216
 *         else:
 *             # All columns are in binary format
 *             writer.write_int32(0x00010001)             # <<<<<<<<<<<<<<
 * 
 *         return writer
*/
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_v_writer->__pyx_vtab)->write_int32(__pyx_v_writer, 0x00010001); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L49:;

  /* "asyncpg/protocol/prepared_stmt.pyx":218
 *             writer.write_int32(0x00010001)
 * 
 *         return writer             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_rows_decoder(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_writer);
  __pyx_r = ((PyObject *)__pyx_v_writer);
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":111
 *         self.prepared = False
 * 
 *     cdef _encode_bind_msg(self, args, int seqno = -1):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int idx
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_writer);
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_hint);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_value_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":220
 *         return writer
 * 
 *     cdef _ensure_rows_decoder(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             list cols_names
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_v_cols_names = 0;
  PyObject *__pyx_v_cols_mapping = 0;
  PyObject *__pyx_v_row = 0;
  uint32_t __pyx_v_oid;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_codecs = 0;
  long __pyx_v_i;
  PyObject *__pyx_v_col_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int16_t __pyx_t_7;
  int __pyx_t_8;
  uint32_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_rows_decoder", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":229
 *             list codecs
 * 
 *         if self.cols_desc is not None:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_1 = (__pyx_v_self->cols_desc != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/prepared_stmt.pyx":230
 * 
 *         if self.cols_desc is not None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if self.cols_num == 0:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/prepared_stmt.pyx":229
 *             list codecs
 * 
 *         if self.cols_desc is not None:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":232
 *             return
 * 
 *         if self.cols_num == 0:             # <<<<<<<<<<<<<<
 *             self.cols_desc = RecordDescriptor({}, ())
 *             return
*/
  __pyx_t_1 = (__pyx_v_self->cols_num == 0);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/prepared_stmt.pyx":233
 * 
 *         if self.cols_num == 0:
 *             self.cols_desc = RecordDescriptor({}, ())             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->cols_desc);
    __Pyx_DECREF(__pyx_v_self->cols_desc);
    __pyx_v_self->cols_desc = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":234
 *         if self.cols_num == 0:
 *             self.cols_desc = RecordDescriptor({}, ())
 *             return             # <<<<<<<<<<<<<<
 * 
 *         cols_mapping = collections.OrderedDict()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/prepared_stmt.pyx":232
 *             return
 * 
 *         if self.cols_num == 0:             # <<<<<<<<<<<<<<
 *             self.cols_desc = RecordDescriptor({}, ())
 *             return
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":236
 *             return
 * 
 *         cols_mapping = collections.OrderedDict()             # <<<<<<<<<<<<<<
 *         cols_names = []
 *         codecs = []
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_cols_mapping = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":237
 * 
 *         cols_mapping = collections.OrderedDict()
 *         cols_names = []             # <<<<<<<<<<<<<<
 *         codecs = []
 *         for i from 0 <= i < self.cols_num:
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_cols_names = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":238
 *         cols_mapping = collections.OrderedDict()
 *         cols_names = []
 *         codecs = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < self.cols_num:
 *             row = self.row_desc[i]
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_codecs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":239
 *         cols_names = []
 *         codecs = []
 *         for i from 0 <= i < self.cols_num:             # <<<<<<<<<<<<<<
 *             row = self.row_desc[i]
 *             col_name = row[0].decode(self.settings._encoding)
*/
  __pyx_t_7 = __pyx_v_self->cols_num;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "asyncpg/protocol/prepared_stmt.pyx":240
 *         codecs = []
 *         for i from 0 <= i < self.cols_num:
 *             row = self.row_desc[i]             # <<<<<<<<<<<<<<
 *             col_name = row[0].decode(self.settings._encoding)
 *             cols_mapping[col_name] = i
*/
    if (unlikely(__pyx_v_self->row_desc == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(17, 240, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->row_desc, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(17, 240, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":241
 *         for i from 0 <= i < self.cols_num:
 *             row = self.row_desc[i]
 *             col_name = row[0].decode(self.settings._encoding)             # <<<<<<<<<<<<<<
 *             cols_mapping[col_name] = i
 *             cols_names.append(col_name)
*/
    if (unlikely(__pyx_v_row == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(17, 241, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->settings->_encoding};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_col_name, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":242
 *             row = self.row_desc[i]
 *             col_name = row[0].decode(self.settings._encoding)
 *             cols_mapping[col_name] = i             # <<<<<<<<<<<<<<
 *             cols_names.append(col_name)
 *             oid = row[3]
*/
    __pyx_t_2 = __Pyx_PyLong_From_long(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely((PyObject_SetItem(__pyx_v_cols_mapping, __pyx_v_col_name, __pyx_t_2) < 0))) __PYX_ERR(17, 242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":243
 *             col_name = row[0].decode(self.settings._encoding)
 *             cols_mapping[col_name] = i
 *             cols_names.append(col_name)             # <<<<<<<<<<<<<<
 *             oid = row[3]
 *             codec = self.settings.get_data_codec(
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_cols_names, __pyx_v_col_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 243, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":244
 *             cols_mapping[col_name] = i
 *             cols_names.append(col_name)
 *             oid = row[3]             # <<<<<<<<<<<<<<
 *             codec = self.settings.get_data_codec(
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
*/
    if (unlikely(__pyx_v_row == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(17, 244, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_row, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyLong_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 244, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_oid = __pyx_t_9;

    /* "asyncpg/protocol/prepared_stmt.pyx":245
 *             cols_names.append(col_name)
 *             oid = row[3]
 *             codec = self.settings.get_data_codec(             # <<<<<<<<<<<<<<
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_decoder():
*/
    __pyx_t_4 = ((PyObject *)__pyx_v_self->settings);
    __Pyx_INCREF(__pyx_t_4);

    /* "asyncpg/protocol/prepared_stmt.pyx":246
 *             oid = row[3]
 *             codec = self.settings.get_data_codec(
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)             # <<<<<<<<<<<<<<
 *             if codec is None or not codec.has_decoder():
 *                 raise exceptions.InternalClientError(
*/
    __pyx_t_3 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_custom_codec, __pyx_t_5, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 245, __pyx_L1_error)
      __pyx_t_2 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 245, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":245
 *             cols_names.append(col_name)
 *             oid = row[3]
 *             codec = self.settings.get_data_codec(             # <<<<<<<<<<<<<<
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_decoder():
*/
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(17, 245, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":247
 *             codec = self.settings.get_data_codec(
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_decoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for OID {}'.format(oid))
*/
    __pyx_t_11 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (!__pyx_t_11) {
    } else {
      __pyx_t_1 = __pyx_t_11;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder(__pyx_v_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(17, 247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = (!__pyx_t_11);
    __pyx_t_1 = __pyx_t_12;
    __pyx_L8_bool_binop_done:;
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/prepared_stmt.pyx":248
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_decoder():
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'no decoder for OID {}'.format(oid))
 *             if not codec.is_binary():
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":249
 *             if codec is None or not codec.has_decoder():
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for OID {}'.format(oid))             # <<<<<<<<<<<<<<
 *             if not codec.is_binary():
 *                 self.have_text_cols = True
*/
      __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_no_decoder_for_OID;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_13 = __Pyx_PyLong_From_uint32_t(__pyx_v_oid); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 249, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(17, 248, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":247
 *             codec = self.settings.get_data_codec(
 *                 oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_decoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for OID {}'.format(oid))
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":250
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for OID {}'.format(oid))
 *             if not codec.is_binary():             # <<<<<<<<<<<<<<
 *                 self.have_text_cols = True
 * 
*/
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary(__pyx_v_codec); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(17, 250, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_12 = (!__pyx_t_1);
    if (__pyx_t_12) {

      /* "asyncpg/protocol/prepared_stmt.pyx":251
 *                     'no decoder for OID {}'.format(oid))
 *             if not codec.is_binary():
 *                 self.have_text_cols = True             # <<<<<<<<<<<<<<
 * 
 *             codecs.append(codec)
*/
      __pyx_v_self->have_text_cols = 1;

      /* "asyncpg/protocol/prepared_stmt.pyx":250
 *                 raise exceptions.InternalClientError(
 *                     'no decoder for OID {}'.format(oid))
 *             if not codec.is_binary():             # <<<<<<<<<<<<<<
 *                 self.have_text_cols = True
 * 
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":253
 *                 self.have_text_cols = True
 * 
 *             codecs.append(codec)             # <<<<<<<<<<<<<<
 * 
 *         self.cols_desc = RecordDescriptor(
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(17, 253, __pyx_L1_error)
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":255
 *             codecs.append(codec)
 * 
 *         self.cols_desc = RecordDescriptor(             # <<<<<<<<<<<<<<
 *             cols_mapping, tuple(cols_names))
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "asyncpg/protocol/prepared_stmt.pyx":256
 * 
 *         self.cols_desc = RecordDescriptor(
 *             cols_mapping, tuple(cols_names))             # <<<<<<<<<<<<<<
 * 
 *         self.rows_codecs = tuple(codecs)
*/
  __pyx_t_10 = PyList_AsTuple(__pyx_v_cols_names); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_cols_mapping, __pyx_t_10};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":255
 *             codecs.append(codec)
 * 
 *         self.cols_desc = RecordDescriptor(             # <<<<<<<<<<<<<<
 *             cols_mapping, tuple(cols_names))
 * 
*/
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->cols_desc);
  __Pyx_DECREF(__pyx_v_self->cols_desc);
  __pyx_v_self->cols_desc = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":258
 *             cols_mapping, tuple(cols_names))
 * 
 *         self.rows_codecs = tuple(codecs)             # <<<<<<<<<<<<<<
 * 
 *     cdef _ensure_args_encoder(self):
*/
  __pyx_t_2 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->rows_codecs);
  __Pyx_DECREF(__pyx_v_self->rows_codecs);
  __pyx_v_self->rows_codecs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":220
 *         return writer
 * 
 *     cdef _ensure_rows_decoder(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             list cols_names
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._ensure_rows_decoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cols_names);
  __Pyx_XDECREF(__pyx_v_cols_mapping);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_codecs);
  __Pyx_XDECREF(__pyx_v_col_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":260
 *         self.rows_codecs = tuple(codecs)
 * 
 *     cdef _ensure_args_encoder(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t p_oid
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  uint32_t __pyx_v_p_oid;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  PyObject *__pyx_v_codecs = 0;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int16_t __pyx_t_4;
  uint32_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_args_encoder", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":264
 *             uint32_t p_oid
 *             Codec codec
 *             list codecs = []             # <<<<<<<<<<<<<<
 * 
 *         if self.args_num == 0 or self.args_codecs is not None:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":266
 *             list codecs = []
 * 
 *         if self.args_num == 0 or self.args_codecs is not None:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_3 = (__pyx_v_self->args_num == 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_self->args_codecs != ((PyObject*)Py_None));
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/prepared_stmt.pyx":267
 * 
 *         if self.args_num == 0 or self.args_codecs is not None:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < self.args_num:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/prepared_stmt.pyx":266
 *             list codecs = []
 * 
 *         if self.args_num == 0 or self.args_codecs is not None:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":269
 *             return
 * 
 *         for i from 0 <= i < self.args_num:             # <<<<<<<<<<<<<<
 *             p_oid = self.parameters_desc[i]
 *             codec = self.settings.get_data_codec(
*/
  __pyx_t_4 = __pyx_v_self->args_num;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "asyncpg/protocol/prepared_stmt.pyx":270
 * 
 *         for i from 0 <= i < self.args_num:
 *             p_oid = self.parameters_desc[i]             # <<<<<<<<<<<<<<
 *             codec = self.settings.get_data_codec(
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
*/
    if (unlikely(__pyx_v_self->parameters_desc == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(17, 270, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->parameters_desc, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyLong_As_uint32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(17, 270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_p_oid = __pyx_t_5;

    /* "asyncpg/protocol/prepared_stmt.pyx":271
 *         for i from 0 <= i < self.args_num:
 *             p_oid = self.parameters_desc[i]
 *             codec = self.settings.get_data_codec(             # <<<<<<<<<<<<<<
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_encoder():
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self->settings);
    __Pyx_INCREF(__pyx_t_6);

    /* "asyncpg/protocol/prepared_stmt.pyx":272
 *             p_oid = self.parameters_desc[i]
 *             codec = self.settings.get_data_codec(
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)             # <<<<<<<<<<<<<<
 *             if codec is None or not codec.has_encoder():
 *                 raise exceptions.InternalClientError(
*/
    __pyx_t_7 = __Pyx_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_ignore_custom_codec, __pyx_t_8, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(17, 271, __pyx_L1_error)
      __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":271
 *         for i from 0 <= i < self.args_num:
 *             p_oid = self.parameters_desc[i]
 *             codec = self.settings.get_data_codec(             # <<<<<<<<<<<<<<
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_encoder():
*/
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(17, 271, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":273
 *             codec = self.settings.get_data_codec(
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_encoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no encoder for OID {}'.format(p_oid))
*/
    __pyx_t_3 = (((PyObject *)__pyx_v_codec) == Py_None);
    if (!__pyx_t_3) {
    } else {
      __pyx_t_2 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_v_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(17, 273, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = (!__pyx_t_3);
    __pyx_t_2 = __pyx_t_11;
    __pyx_L9_bool_binop_done:;
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/prepared_stmt.pyx":274
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_encoder():
 *                 raise exceptions.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'no encoder for OID {}'.format(p_oid))
 *             if codec.type not in {}:
*/
      __pyx_t_10 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":275
 *             if codec is None or not codec.has_encoder():
 *                 raise exceptions.InternalClientError(
 *                     'no encoder for OID {}'.format(p_oid))             # <<<<<<<<<<<<<<
 *             if codec.type not in {}:
 *                 self.have_text_args = True
*/
      __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_no_encoder_for_OID;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_12)) __PYX_ERR(17, 275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_12};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 275, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_9 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_10);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_9 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(17, 274, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":273
 *             codec = self.settings.get_data_codec(
 *                 p_oid, ignore_custom_codec=self.ignore_custom_codec)
 *             if codec is None or not codec.has_encoder():             # <<<<<<<<<<<<<<
 *                 raise exceptions.InternalClientError(
 *                     'no encoder for OID {}'.format(p_oid))
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":276
 *                 raise exceptions.InternalClientError(
 *                     'no encoder for OID {}'.format(p_oid))
 *             if codec.type not in {}:             # <<<<<<<<<<<<<<
 *                 self.have_text_args = True
 * 
*/
    __pyx_t_1 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(__pyx_v_codec->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_t_7, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(17, 276, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_2) {

      /* "asyncpg/protocol/prepared_stmt.pyx":277
 *                     'no encoder for OID {}'.format(p_oid))
 *             if codec.type not in {}:
 *                 self.have_text_args = True             # <<<<<<<<<<<<<<
 * 
 *             codecs.append(codec)
*/
      __pyx_v_self->have_text_args = 1;

      /* "asyncpg/protocol/prepared_stmt.pyx":276
 *                 raise exceptions.InternalClientError(
 *                     'no encoder for OID {}'.format(p_oid))
 *             if codec.type not in {}:             # <<<<<<<<<<<<<<
 *                 self.have_text_args = True
 * 
*/
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":279
 *                 self.have_text_args = True
 * 
 *             codecs.append(codec)             # <<<<<<<<<<<<<<
 * 
 *         self.args_codecs = tuple(codecs)
*/
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_codecs, ((PyObject *)__pyx_v_codec)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(17, 279, __pyx_L1_error)
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":281
 *             codecs.append(codec)
 * 
 *         self.args_codecs = tuple(codecs)             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_row_desc(self, object desc):
*/
  __pyx_t_7 = PyList_AsTuple(__pyx_v_codecs); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_GOTREF(__pyx_v_self->args_codecs);
  __Pyx_DECREF(__pyx_v_self->args_codecs);
  __pyx_v_self->args_codecs = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":260
 *         self.rows_codecs = tuple(codecs)
 * 
 *     cdef _ensure_args_encoder(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t p_oid
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._ensure_args_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_codecs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":283
 *         self.args_codecs = tuple(codecs)
 * 
 *     cdef _set_row_desc(self, object desc):             # <<<<<<<<<<<<<<
 *         self.row_desc = _decode_row_desc(desc)
 *         self.cols_num = <int16_t>(len(self.row_desc))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_row_desc", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":284
 * 
 *     cdef _set_row_desc(self, object desc):
 *         self.row_desc = _decode_row_desc(desc)             # <<<<<<<<<<<<<<
 *         self.cols_num = <int16_t>(len(self.row_desc))
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(__pyx_v_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(17, 284, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->row_desc);
  __Pyx_DECREF(__pyx_v_self->row_desc);
  __pyx_v_self->row_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":285
 *     cdef _set_row_desc(self, object desc):
 *         self.row_desc = _decode_row_desc(desc)
 *         self.cols_num = <int16_t>(len(self.row_desc))             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_args_desc(self, object desc):
*/
  __pyx_t_1 = __pyx_v_self->row_desc;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(17, 285, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(17, 285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->cols_num = ((int16_t)__pyx_t_2);

  /* "asyncpg/protocol/prepared_stmt.pyx":283
 *         self.args_codecs = tuple(codecs)
 * 
 *     cdef _set_row_desc(self, object desc):             # <<<<<<<<<<<<<<
 *         self.row_desc = _decode_row_desc(desc)
 *         self.cols_num = <int16_t>(len(self.row_desc))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._set_row_desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":287
 *         self.cols_num = <int16_t>(len(self.row_desc))
 * 
 *     cdef _set_args_desc(self, object desc):             # <<<<<<<<<<<<<<
 *         self.parameters_desc = _decode_parameters_desc(desc)
 *         self.args_num = <int16_t>(len(self.parameters_desc))
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, PyObject *__pyx_v_desc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_args_desc", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":288
 * 
 *     cdef _set_args_desc(self, object desc):
 *         self.parameters_desc = _decode_parameters_desc(desc)             # <<<<<<<<<<<<<<
 *         self.args_num = <int16_t>(len(self.parameters_desc))
 * 
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(__pyx_v_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(17, 288, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->parameters_desc);
  __Pyx_DECREF(__pyx_v_self->parameters_desc);
  __pyx_v_self->parameters_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":289
 *     cdef _set_args_desc(self, object desc):
 *         self.parameters_desc = _decode_parameters_desc(desc)
 *         self.args_num = <int16_t>(len(self.parameters_desc))             # <<<<<<<<<<<<<<
 * 
 *     cdef _decode_row(self, const char* cbuf, ssize_t buf_len):
*/
  __pyx_t_1 = __pyx_v_self->parameters_desc;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(17, 289, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(17, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->args_num = ((int16_t)__pyx_t_2);

  /* "asyncpg/protocol/prepared_stmt.pyx":287
 *         self.cols_num = <int16_t>(len(self.row_desc))
 * 
 *     cdef _set_args_desc(self, object desc):             # <<<<<<<<<<<<<<
 *         self.parameters_desc = _decode_parameters_desc(desc)
 *         self.args_num = <int16_t>(len(self.parameters_desc))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._set_args_desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":291
 *         self.args_num = <int16_t>(len(self.parameters_desc))
 * 
 *     cdef _decode_row(self, const char* cbuf, ssize_t buf_len):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self, char const *__pyx_v_cbuf, Py_ssize_t __pyx_v_buf_len) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *__pyx_v_codec = 0;
  int16_t __pyx_v_fnum;
  int32_t __pyx_v_flen;
  PyObject *__pyx_v_dec_row = 0;
  PyObject *__pyx_v_rows_codecs = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *__pyx_v_settings = 0;
  int32_t __pyx_v_i;
  struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer __pyx_v_rbuf;
  Py_ssize_t __pyx_v_bl;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int16_t __pyx_t_11;
  int16_t __pyx_t_12;
  int32_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_row", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":297
 *             int32_t flen
 *             object dec_row
 *             tuple rows_codecs = self.rows_codecs             # <<<<<<<<<<<<<<
 *             ConnectionSettings settings = self.settings
 *             int32_t i
*/
  __pyx_t_1 = __pyx_v_self->rows_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_rows_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":298
 *             object dec_row
 *             tuple rows_codecs = self.rows_codecs
 *             ConnectionSettings settings = self.settings             # <<<<<<<<<<<<<<
 *             int32_t i
 *             FRBuffer rbuf
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self->settings);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":303
 *             ssize_t bl
 * 
 *         frb_init(&rbuf, cbuf, buf_len)             # <<<<<<<<<<<<<<
 * 
 *         fnum = hton.unpack_int16(frb_read(&rbuf, 2))
*/
  __pyx_f_7asyncpg_7pgproto_7pgproto_frb_init((&__pyx_v_rbuf), __pyx_v_cbuf, __pyx_v_buf_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 303, __pyx_L1_error)

  /* "asyncpg/protocol/prepared_stmt.pyx":305
 *         frb_init(&rbuf, cbuf, buf_len)
 * 
 *         fnum = hton.unpack_int16(frb_read(&rbuf, 2))             # <<<<<<<<<<<<<<
 * 
 *         if fnum != self.cols_num:
*/
  __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read((&__pyx_v_rbuf), 2); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(17, 305, __pyx_L1_error)
  __pyx_v_fnum = unpack_int16(__pyx_t_2);

  /* "asyncpg/protocol/prepared_stmt.pyx":307
 *         fnum = hton.unpack_int16(frb_read(&rbuf, 2))
 * 
 *         if fnum != self.cols_num:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'the number of columns in the result row ({}) is '
*/
  __pyx_t_3 = (__pyx_v_fnum != __pyx_v_self->cols_num);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/prepared_stmt.pyx":308
 * 
 *         if fnum != self.cols_num:
 *             raise exceptions.ProtocolError(             # <<<<<<<<<<<<<<
 *                 'the number of columns in the result row ({}) is '
 *                 'different from what was described ({})'.format(
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":310
 *             raise exceptions.ProtocolError(
 *                 'the number of columns in the result row ({}) is '
 *                 'different from what was described ({})'.format(             # <<<<<<<<<<<<<<
 *                     fnum, self.cols_num))
 * 
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_the_number_of_columns_in_the_res;
    __Pyx_INCREF(__pyx_t_7);

    /* "asyncpg/protocol/prepared_stmt.pyx":311
 *                 'the number of columns in the result row ({}) is '
 *                 'different from what was described ({})'.format(
 *                     fnum, self.cols_num))             # <<<<<<<<<<<<<<
 * 
 *         dec_row = self.cols_desc.make_record(self.record_class, fnum)
*/
    __pyx_t_8 = __Pyx_PyLong_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyLong_From_int16_t(__pyx_v_self->cols_num); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_9};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 310, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(17, 308, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":307
 *         fnum = hton.unpack_int16(frb_read(&rbuf, 2))
 * 
 *         if fnum != self.cols_num:             # <<<<<<<<<<<<<<
 *             raise exceptions.ProtocolError(
 *                 'the number of columns in the result row ({}) is '
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":313
 *                     fnum, self.cols_num))
 * 
 *         dec_row = self.cols_desc.make_record(self.record_class, fnum)             # <<<<<<<<<<<<<<
 *         for i in range(fnum):
 *             flen = hton.unpack_int32(frb_read(&rbuf, 4))
*/
  __pyx_t_6 = __pyx_v_self->cols_desc;
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_From_int16_t(__pyx_v_fnum); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self->record_class), __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_dec_row = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":314
 * 
 *         dec_row = self.cols_desc.make_record(self.record_class, fnum)
 *         for i in range(fnum):             # <<<<<<<<<<<<<<
 *             flen = hton.unpack_int32(frb_read(&rbuf, 4))
 * 
*/
  __pyx_t_11 = __pyx_v_fnum;
  __pyx_t_12 = __pyx_t_11;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "asyncpg/protocol/prepared_stmt.pyx":315
 *         dec_row = self.cols_desc.make_record(self.record_class, fnum)
 *         for i in range(fnum):
 *             flen = hton.unpack_int32(frb_read(&rbuf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if flen == -1:
*/
    __pyx_t_2 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_read((&__pyx_v_rbuf), 4); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(17, 315, __pyx_L1_error)
    __pyx_v_flen = unpack_int32(__pyx_t_2);

    /* "asyncpg/protocol/prepared_stmt.pyx":317
 *             flen = hton.unpack_int32(frb_read(&rbuf, 4))
 * 
 *             if flen == -1:             # <<<<<<<<<<<<<<
 *                 val = None
 *             else:
*/
    __pyx_t_3 = (__pyx_v_flen == -1L);
    if (__pyx_t_3) {

      /* "asyncpg/protocol/prepared_stmt.pyx":318
 * 
 *             if flen == -1:
 *                 val = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # Clamp buffer size to that of the reported field length
*/
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_val, Py_None);

      /* "asyncpg/protocol/prepared_stmt.pyx":317
 *             flen = hton.unpack_int32(frb_read(&rbuf, 4))
 * 
 *             if flen == -1:             # <<<<<<<<<<<<<<
 *                 val = None
 *             else:
*/
      goto __pyx_L6;
    }

    /* "asyncpg/protocol/prepared_stmt.pyx":323
 *                 # to make sure that codecs can rely on read_all() working
 *                 # properly.
 *                 bl = frb_get_len(&rbuf)             # <<<<<<<<<<<<<<
 *                 if flen > bl:
 *                     frb_check(&rbuf, flen)
*/
    /*else*/ {
      __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1L) && PyErr_Occurred())) __PYX_ERR(17, 323, __pyx_L1_error)
      __pyx_v_bl = __pyx_t_14;

      /* "asyncpg/protocol/prepared_stmt.pyx":324
 *                 # properly.
 *                 bl = frb_get_len(&rbuf)
 *                 if flen > bl:             # <<<<<<<<<<<<<<
 *                     frb_check(&rbuf, flen)
 *                 frb_set_len(&rbuf, flen)
*/
      __pyx_t_3 = (__pyx_v_flen > __pyx_v_bl);
      if (__pyx_t_3) {

        /* "asyncpg/protocol/prepared_stmt.pyx":325
 *                 bl = frb_get_len(&rbuf)
 *                 if flen > bl:
 *                     frb_check(&rbuf, flen)             # <<<<<<<<<<<<<<
 *                 frb_set_len(&rbuf, flen)
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)
*/
        __pyx_t_1 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_check((&__pyx_v_rbuf), __pyx_v_flen); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 325, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/prepared_stmt.pyx":324
 *                 # properly.
 *                 bl = frb_get_len(&rbuf)
 *                 if flen > bl:             # <<<<<<<<<<<<<<
 *                     frb_check(&rbuf, flen)
 *                 frb_set_len(&rbuf, flen)
*/
      }

      /* "asyncpg/protocol/prepared_stmt.pyx":326
 *                 if flen > bl:
 *                     frb_check(&rbuf, flen)
 *                 frb_set_len(&rbuf, flen)             # <<<<<<<<<<<<<<
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)
 *                 val = codec.decode(settings, &rbuf)
*/
      __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len((&__pyx_v_rbuf), __pyx_v_flen); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 326, __pyx_L1_error)

      /* "asyncpg/protocol/prepared_stmt.pyx":327
 *                     frb_check(&rbuf, flen)
 *                 frb_set_len(&rbuf, flen)
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)             # <<<<<<<<<<<<<<
 *                 val = codec.decode(settings, &rbuf)
 *                 if frb_get_len(&rbuf) != 0:
*/
      __pyx_t_15 = PyTuple_GET_ITEM(__pyx_v_rows_codecs, __pyx_v_i);
      __pyx_t_1 = ((PyObject *)__pyx_t_15);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":328
 *                 frb_set_len(&rbuf, flen)
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)
 *                 val = codec.decode(settings, &rbuf)             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&rbuf) != 0:
 *                     raise BufferError(
*/
      __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode(__pyx_v_codec, __pyx_v_settings, (&__pyx_v_rbuf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/prepared_stmt.pyx":329
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)
 *                 val = codec.decode(settings, &rbuf)
 *                 if frb_get_len(&rbuf) != 0:             # <<<<<<<<<<<<<<
 *                     raise BufferError(
 *                         'unexpected trailing {} bytes in buffer'.format(
*/
      __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1L) && PyErr_Occurred())) __PYX_ERR(17, 329, __pyx_L1_error)
      __pyx_t_3 = (__pyx_t_14 != 0);
      if (unlikely(__pyx_t_3)) {

        /* "asyncpg/protocol/prepared_stmt.pyx":330
 *                 val = codec.decode(settings, &rbuf)
 *                 if frb_get_len(&rbuf) != 0:
 *                     raise BufferError(             # <<<<<<<<<<<<<<
 *                         'unexpected trailing {} bytes in buffer'.format(
 *                             frb_get_len(&rbuf)))
*/
        __pyx_t_5 = NULL;

        /* "asyncpg/protocol/prepared_stmt.pyx":331
 *                 if frb_get_len(&rbuf) != 0:
 *                     raise BufferError(
 *                         'unexpected trailing {} bytes in buffer'.format(             # <<<<<<<<<<<<<<
 *                             frb_get_len(&rbuf)))
 *                 frb_set_len(&rbuf, bl - flen)
*/
        __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_bytes_in_buf;
        __Pyx_INCREF(__pyx_t_4);

        /* "asyncpg/protocol/prepared_stmt.pyx":332
 *                     raise BufferError(
 *                         'unexpected trailing {} bytes in buffer'.format(
 *                             frb_get_len(&rbuf)))             # <<<<<<<<<<<<<<
 *                 frb_set_len(&rbuf, bl - flen)
 * 
*/
        __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1L) && PyErr_Occurred())) __PYX_ERR(17, 332, __pyx_L1_error)
        __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 331, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_10 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_BufferError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 330, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(17, 330, __pyx_L1_error)

        /* "asyncpg/protocol/prepared_stmt.pyx":329
 *                 codec = <Codec>cpython.PyTuple_GET_ITEM(rows_codecs, i)
 *                 val = codec.decode(settings, &rbuf)
 *                 if frb_get_len(&rbuf) != 0:             # <<<<<<<<<<<<<<
 *                     raise BufferError(
 *                         'unexpected trailing {} bytes in buffer'.format(
*/
      }

      /* "asyncpg/protocol/prepared_stmt.pyx":333
 *                         'unexpected trailing {} bytes in buffer'.format(
 *                             frb_get_len(&rbuf)))
 *                 frb_set_len(&rbuf, bl - flen)             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(val)
*/
      __pyx_f_7asyncpg_7pgproto_7pgproto_frb_set_len((&__pyx_v_rbuf), (__pyx_v_bl - __pyx_v_flen)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 333, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "asyncpg/protocol/prepared_stmt.pyx":335
 *                 frb_set_len(&rbuf, bl - flen)
 * 
 *             cpython.Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             recordcapi.ApgRecord_SET_ITEM(dec_row, i, val)
 * 
*/
    Py_INCREF(__pyx_v_val);

    /* "asyncpg/protocol/prepared_stmt.pyx":336
 * 
 *             cpython.Py_INCREF(val)
 *             recordcapi.ApgRecord_SET_ITEM(dec_row, i, val)             # <<<<<<<<<<<<<<
 * 
 *         if frb_get_len(&rbuf) != 0:
*/
    ApgRecord_SET_ITEM(__pyx_v_dec_row, __pyx_v_i, __pyx_v_val);
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":338
 *             recordcapi.ApgRecord_SET_ITEM(dec_row, i, val)
 * 
 *         if frb_get_len(&rbuf) != 0:             # <<<<<<<<<<<<<<
 *             raise BufferError('unexpected trailing {} bytes in buffer'.format(
 *                 frb_get_len(&rbuf)))
*/
  __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1L) && PyErr_Occurred())) __PYX_ERR(17, 338, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_14 != 0);
  if (unlikely(__pyx_t_3)) {

    /* "asyncpg/protocol/prepared_stmt.pyx":339
 * 
 *         if frb_get_len(&rbuf) != 0:
 *             raise BufferError('unexpected trailing {} bytes in buffer'.format(             # <<<<<<<<<<<<<<
 *                 frb_get_len(&rbuf)))
 * 
*/
    __pyx_t_6 = NULL;
    __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_bytes_in_buf;
    __Pyx_INCREF(__pyx_t_9);

    /* "asyncpg/protocol/prepared_stmt.pyx":340
 *         if frb_get_len(&rbuf) != 0:
 *             raise BufferError('unexpected trailing {} bytes in buffer'.format(
 *                 frb_get_len(&rbuf)))             # <<<<<<<<<<<<<<
 * 
 *         return dec_row
*/
    __pyx_t_14 = __pyx_f_7asyncpg_7pgproto_7pgproto_frb_get_len((&__pyx_v_rbuf)); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1L) && PyErr_Occurred())) __PYX_ERR(17, 340, __pyx_L1_error)
    __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_BufferError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(17, 339, __pyx_L1_error)

    /* "asyncpg/protocol/prepared_stmt.pyx":338
 *             recordcapi.ApgRecord_SET_ITEM(dec_row, i, val)
 * 
 *         if frb_get_len(&rbuf) != 0:             # <<<<<<<<<<<<<<
 *             raise BufferError('unexpected trailing {} bytes in buffer'.format(
 *                 frb_get_len(&rbuf)))
*/
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":342
 *                 frb_get_len(&rbuf)))
 * 
 *         return dec_row             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dec_row);
  __pyx_r = __pyx_v_dec_row;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":291
 *         self.args_num = <int16_t>(len(self.parameters_desc))
 * 
 *     cdef _decode_row(self, const char* cbuf, ssize_t buf_len):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState._decode_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_dec_row);
  __Pyx_XDECREF(__pyx_v_rows_codecs);
  __Pyx_XDECREF((PyObject *)__pyx_v_settings);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pxd":10
 * cdef class PreparedStatementState:
 *     cdef:
 *         readonly str name             # <<<<<<<<<<<<<<
 *         readonly str query
 *         readonly bint closed
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* "asyncpg/protocol/prepared_stmt.pxd":11
 *     cdef:
 *         readonly str name
 *         readonly str query             # <<<<<<<<<<<<<<
 *         readonly bint closed
 *         readonly bint prepared
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->query);
  __pyx_r = __pyx_v_self->query;
  goto __pyx_L0;

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

/* "asyncpg/protocol/prepared_stmt.pxd":12
 *         readonly str name
 *         readonly str query
 *         readonly bint closed             # <<<<<<<<<<<<<<
 *         readonly bint prepared
 *         readonly int refs
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.closed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pxd":13
 *         readonly str query
 *         readonly bint closed
 *         readonly bint prepared             # <<<<<<<<<<<<<<
 *         readonly int refs
 *         readonly type record_class
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->prepared); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.prepared.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pxd":14
 *         readonly bint closed
 *         readonly bint prepared
 *         readonly int refs             # <<<<<<<<<<<<<<
 *         readonly type record_class
 *         readonly bint ignore_custom_codec
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->refs); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.refs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pxd":15
 *         readonly bint prepared
 *         readonly int refs
 *         readonly type record_class             # <<<<<<<<<<<<<<
 *         readonly bint ignore_custom_codec
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->record_class);
  __pyx_r = ((PyObject *)__pyx_v_self->record_class);
  goto __pyx_L0;

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

/* "asyncpg/protocol/prepared_stmt.pxd":16
 *         readonly int refs
 *         readonly type record_class
 *         readonly bint ignore_custom_codec             # <<<<<<<<<<<<<<
 * 
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->ignore_custom_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.ignore_custom_codec.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_18__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_22PreparedStatementState_20__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(9, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.PreparedStatementState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":345
 * 
 * 
 * cdef _decode_parameters_desc(object desc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ReadBuffer reader
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_parameters_desc(PyObject *__pyx_v_desc) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_reader = 0;
  int16_t __pyx_v_nparams;
  uint32_t __pyx_v_p_oid;
  PyObject *__pyx_v_result = 0;
  CYTHON_UNUSED long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int16_t __pyx_t_2;
  int32_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_parameters_desc", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":350
 *         int16_t nparams
 *         uint32_t p_oid
 *         list result = []             # <<<<<<<<<<<<<<
 * 
 *     reader = ReadBuffer.new_message_parser(desc)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":352
 *         list result = []
 * 
 *     reader = ReadBuffer.new_message_parser(desc)             # <<<<<<<<<<<<<<
 *     nparams = reader.read_int16()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer->new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reader = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":353
 * 
 *     reader = ReadBuffer.new_message_parser(desc)
 *     nparams = reader.read_int16()             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < nparams:
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 353, __pyx_L1_error)
  __pyx_v_nparams = __pyx_t_2;

  /* "asyncpg/protocol/prepared_stmt.pyx":355
 *     nparams = reader.read_int16()
 * 
 *     for i from 0 <= i < nparams:             # <<<<<<<<<<<<<<
 *         p_oid = <uint32_t>reader.read_int32()
 *         result.append(p_oid)
*/
  __pyx_t_2 = __pyx_v_nparams;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "asyncpg/protocol/prepared_stmt.pyx":356
 * 
 *     for i from 0 <= i < nparams:
 *         p_oid = <uint32_t>reader.read_int32()             # <<<<<<<<<<<<<<
 *         result.append(p_oid)
 * 
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 356, __pyx_L1_error)
    __pyx_v_p_oid = ((uint32_t)__pyx_t_3);

    /* "asyncpg/protocol/prepared_stmt.pyx":357
 *     for i from 0 <= i < nparams:
 *         p_oid = <uint32_t>reader.read_int32()
 *         result.append(p_oid)             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    __pyx_t_1 = __Pyx_PyLong_From_uint32_t(__pyx_v_p_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(17, 357, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":359
 *         result.append(p_oid)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":345
 * 
 * 
 * cdef _decode_parameters_desc(object desc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ReadBuffer reader
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._decode_parameters_desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/prepared_stmt.pyx":362
 * 
 * 
 * cdef _decode_row_desc(object desc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ReadBuffer reader
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol__decode_row_desc(PyObject *__pyx_v_desc) {
  struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *__pyx_v_reader = 0;
  int16_t __pyx_v_nfields;
  PyObject *__pyx_v_f_name = 0;
  uint32_t __pyx_v_f_table_oid;
  int16_t __pyx_v_f_column_num;
  uint32_t __pyx_v_f_dt_oid;
  int16_t __pyx_v_f_dt_size;
  int32_t __pyx_v_f_dt_mod;
  int16_t __pyx_v_f_format;
  PyObject *__pyx_v_result = 0;
  CYTHON_UNUSED long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int16_t __pyx_t_2;
  int32_t __pyx_t_3;
  int16_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_row_desc", 0);

  /* "asyncpg/protocol/prepared_stmt.pyx":378
 *         list result
 * 
 *     reader = ReadBuffer.new_message_parser(desc)             # <<<<<<<<<<<<<<
 *     nfields = reader.read_int16()
 *     result = []
*/
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer->new_message_parser(__pyx_v_desc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reader = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":379
 * 
 *     reader = ReadBuffer.new_message_parser(desc)
 *     nfields = reader.read_int16()             # <<<<<<<<<<<<<<
 *     result = []
 * 
*/
  __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 379, __pyx_L1_error)
  __pyx_v_nfields = __pyx_t_2;

  /* "asyncpg/protocol/prepared_stmt.pyx":380
 *     reader = ReadBuffer.new_message_parser(desc)
 *     nfields = reader.read_int16()
 *     result = []             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < nfields:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":382
 *     result = []
 * 
 *     for i from 0 <= i < nfields:             # <<<<<<<<<<<<<<
 *         f_name = reader.read_null_str()
 *         f_table_oid = <uint32_t>reader.read_int32()
*/
  __pyx_t_2 = __pyx_v_nfields;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "asyncpg/protocol/prepared_stmt.pyx":383
 * 
 *     for i from 0 <= i < nfields:
 *         f_name = reader.read_null_str()             # <<<<<<<<<<<<<<
 *         f_table_oid = <uint32_t>reader.read_int32()
 *         f_column_num = reader.read_int16()
*/
    __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_null_str(__pyx_v_reader); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(17, 383, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_f_name, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":384
 *     for i from 0 <= i < nfields:
 *         f_name = reader.read_null_str()
 *         f_table_oid = <uint32_t>reader.read_int32()             # <<<<<<<<<<<<<<
 *         f_column_num = reader.read_int16()
 *         f_dt_oid = <uint32_t>reader.read_int32()
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 384, __pyx_L1_error)
    __pyx_v_f_table_oid = ((uint32_t)__pyx_t_3);

    /* "asyncpg/protocol/prepared_stmt.pyx":385
 *         f_name = reader.read_null_str()
 *         f_table_oid = <uint32_t>reader.read_int32()
 *         f_column_num = reader.read_int16()             # <<<<<<<<<<<<<<
 *         f_dt_oid = <uint32_t>reader.read_int32()
 *         f_dt_size = reader.read_int16()
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 385, __pyx_L1_error)
    __pyx_v_f_column_num = __pyx_t_4;

    /* "asyncpg/protocol/prepared_stmt.pyx":386
 *         f_table_oid = <uint32_t>reader.read_int32()
 *         f_column_num = reader.read_int16()
 *         f_dt_oid = <uint32_t>reader.read_int32()             # <<<<<<<<<<<<<<
 *         f_dt_size = reader.read_int16()
 *         f_dt_mod = reader.read_int32()
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 386, __pyx_L1_error)
    __pyx_v_f_dt_oid = ((uint32_t)__pyx_t_3);

    /* "asyncpg/protocol/prepared_stmt.pyx":387
 *         f_column_num = reader.read_int16()
 *         f_dt_oid = <uint32_t>reader.read_int32()
 *         f_dt_size = reader.read_int16()             # <<<<<<<<<<<<<<
 *         f_dt_mod = reader.read_int32()
 *         f_format = reader.read_int16()
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 387, __pyx_L1_error)
    __pyx_v_f_dt_size = __pyx_t_4;

    /* "asyncpg/protocol/prepared_stmt.pyx":388
 *         f_dt_oid = <uint32_t>reader.read_int32()
 *         f_dt_size = reader.read_int16()
 *         f_dt_mod = reader.read_int32()             # <<<<<<<<<<<<<<
 *         f_format = reader.read_int16()
 * 
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int32(__pyx_v_reader); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 388, __pyx_L1_error)
    __pyx_v_f_dt_mod = __pyx_t_3;

    /* "asyncpg/protocol/prepared_stmt.pyx":389
 *         f_dt_size = reader.read_int16()
 *         f_dt_mod = reader.read_int32()
 *         f_format = reader.read_int16()             # <<<<<<<<<<<<<<
 * 
 *         result.append(
*/
    __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_reader->__pyx_vtab)->read_int16(__pyx_v_reader); if (unlikely(__pyx_t_4 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 389, __pyx_L1_error)
    __pyx_v_f_format = __pyx_t_4;

    /* "asyncpg/protocol/prepared_stmt.pyx":392
 * 
 *         result.append(
 *             (f_name, f_table_oid, f_column_num, f_dt_oid,             # <<<<<<<<<<<<<<
 *              f_dt_size, f_dt_mod, f_format))
 * 
*/
    __pyx_t_1 = __Pyx_PyLong_From_uint32_t(__pyx_v_f_table_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyLong_From_int16_t(__pyx_v_f_column_num); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyLong_From_uint32_t(__pyx_v_f_dt_oid); if (unlikely(!__pyx_t_6)) __PYX_ERR(17, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "asyncpg/protocol/prepared_stmt.pyx":393
 *         result.append(
 *             (f_name, f_table_oid, f_column_num, f_dt_oid,
 *              f_dt_size, f_dt_mod, f_format))             # <<<<<<<<<<<<<<
 * 
 *     return result
*/
    __pyx_t_7 = __Pyx_PyLong_From_int16_t(__pyx_v_f_dt_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyLong_From_int32_t(__pyx_v_f_dt_mod); if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyLong_From_int16_t(__pyx_v_f_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(17, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "asyncpg/protocol/prepared_stmt.pyx":392
 * 
 *         result.append(
 *             (f_name, f_table_oid, f_column_num, f_dt_oid,             # <<<<<<<<<<<<<<
 *              f_dt_size, f_dt_mod, f_format))
 * 
*/
    __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_f_name);
    __Pyx_GIVEREF(__pyx_v_f_name);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_f_name) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_6) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_8) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_9) != (0)) __PYX_ERR(17, 392, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;

    /* "asyncpg/protocol/prepared_stmt.pyx":391
 *         f_format = reader.read_int16()
 * 
 *         result.append(             # <<<<<<<<<<<<<<
 *             (f_name, f_table_oid, f_column_num, f_dt_oid,
 *              f_dt_size, f_dt_mod, f_format))
*/
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(17, 391, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }

  /* "asyncpg/protocol/prepared_stmt.pyx":395
 *              f_dt_size, f_dt_mod, f_format))
 * 
 *     return result             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "asyncpg/protocol/prepared_stmt.pyx":362
 * 
 * 
 * cdef _decode_row_desc(object desc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ReadBuffer reader
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._decode_row_desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_v_f_name);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":77
 * 
 * cdef class BaseProtocol(CoreProtocol):
 *     def __init__(self, addr, connected_fut, con_params, record_class: type, loop):             # <<<<<<<<<<<<<<
 *         # type of `con_params` is `_ConnectionParameters`
 *         CoreProtocol.__init__(self, addr, con_params)
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_addr = 0;
  PyObject *__pyx_v_connected_fut = 0;
  PyObject *__pyx_v_con_params = 0;
  PyTypeObject *__pyx_v_record_class = 0;
  PyObject *__pyx_v_loop = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addr,&__pyx_mstate_global->__pyx_n_u_connected_fut,&__pyx_mstate_global->__pyx_n_u_con_params,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_loop,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 77, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 77, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, i); __PYX_ERR(0, 77, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 77, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 77, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 77, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 77, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 77, __pyx_L3_error)
    }
    __pyx_v_addr = values[0];
    __pyx_v_connected_fut = values[1];
    __pyx_v_con_params = values[2];
    __pyx_v_record_class = ((PyTypeObject*)values[3]);
    __pyx_v_loop = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_class), (&PyType_Type), 0, "record_class", 2))) __PYX_ERR(0, 77, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_addr, __pyx_v_connected_fut, __pyx_v_con_params, __pyx_v_record_class, __pyx_v_loop);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol___init__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_addr, PyObject *__pyx_v_connected_fut, PyObject *__pyx_v_con_params, PyTypeObject *__pyx_v_record_class, PyObject *__pyx_v_loop) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "asyncpg/protocol/protocol.pyx":79
 *     def __init__(self, addr, connected_fut, con_params, record_class: type, loop):
 *         # type of `con_params` is `_ConnectionParameters`
 *         CoreProtocol.__init__(self, addr, con_params)             # <<<<<<<<<<<<<<
 * 
 *         self.loop = loop
*/
  __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_addr, __pyx_v_con_params};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":81
 *         CoreProtocol.__init__(self, addr, con_params)
 * 
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         self.transport = None
 *         self.waiter = connected_fut
*/
  __Pyx_INCREF(__pyx_v_loop);
  __Pyx_GIVEREF(__pyx_v_loop);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(__pyx_v_self->loop);
  __pyx_v_self->loop = __pyx_v_loop;

  /* "asyncpg/protocol/protocol.pyx":82
 * 
 *         self.loop = loop
 *         self.transport = None             # <<<<<<<<<<<<<<
 *         self.waiter = connected_fut
 *         self.cancel_waiter = None
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.transport);
  __pyx_v_self->__pyx_base.transport = Py_None;

  /* "asyncpg/protocol/protocol.pyx":83
 *         self.loop = loop
 *         self.transport = None
 *         self.waiter = connected_fut             # <<<<<<<<<<<<<<
 *         self.cancel_waiter = None
 *         self.cancel_sent_waiter = None
*/
  __Pyx_INCREF(__pyx_v_connected_fut);
  __Pyx_GIVEREF(__pyx_v_connected_fut);
  __Pyx_GOTREF(__pyx_v_self->waiter);
  __Pyx_DECREF(__pyx_v_self->waiter);
  __pyx_v_self->waiter = __pyx_v_connected_fut;

  /* "asyncpg/protocol/protocol.pyx":84
 *         self.transport = None
 *         self.waiter = connected_fut
 *         self.cancel_waiter = None             # <<<<<<<<<<<<<<
 *         self.cancel_sent_waiter = None
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cancel_waiter);
  __Pyx_DECREF(__pyx_v_self->cancel_waiter);
  __pyx_v_self->cancel_waiter = Py_None;

  /* "asyncpg/protocol/protocol.pyx":85
 *         self.waiter = connected_fut
 *         self.cancel_waiter = None
 *         self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self.settings = ConnectionSettings((addr, con_params.database))
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cancel_sent_waiter);
  __Pyx_DECREF(__pyx_v_self->cancel_sent_waiter);
  __pyx_v_self->cancel_sent_waiter = Py_None;

  /* "asyncpg/protocol/protocol.pyx":87
 *         self.cancel_sent_waiter = None
 * 
 *         self.settings = ConnectionSettings((addr, con_params.database))             # <<<<<<<<<<<<<<
 *         self.record_class = record_class
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_con_params, __pyx_mstate_global->__pyx_n_u_database); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_addr);
  __Pyx_GIVEREF(__pyx_v_addr);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_addr) != (0)) __PYX_ERR(0, 87, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 87, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->settings);
  __Pyx_DECREF((PyObject *)__pyx_v_self->settings);
  __pyx_v_self->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":88
 * 
 *         self.settings = ConnectionSettings((addr, con_params.database))
 *         self.record_class = record_class             # <<<<<<<<<<<<<<
 * 
 *         self.statement = None
*/
  __Pyx_INCREF((PyObject *)__pyx_v_record_class);
  __Pyx_GIVEREF((PyObject *)__pyx_v_record_class);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->record_class);
  __Pyx_DECREF((PyObject *)__pyx_v_self->record_class);
  __pyx_v_self->record_class = __pyx_v_record_class;

  /* "asyncpg/protocol/protocol.pyx":90
 *         self.record_class = record_class
 * 
 *         self.statement = None             # <<<<<<<<<<<<<<
 *         self.return_extra = False
 * 
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->statement);
  __Pyx_DECREF((PyObject *)__pyx_v_self->statement);
  __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None);

  /* "asyncpg/protocol/protocol.pyx":91
 * 
 *         self.statement = None
 *         self.return_extra = False             # <<<<<<<<<<<<<<
 * 
 *         self.last_query = None
*/
  __pyx_v_self->return_extra = 0;

  /* "asyncpg/protocol/protocol.pyx":93
 *         self.return_extra = False
 * 
 *         self.last_query = None             # <<<<<<<<<<<<<<
 * 
 *         self.closing = False
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->last_query);
  __Pyx_DECREF(__pyx_v_self->last_query);
  __pyx_v_self->last_query = ((PyObject*)Py_None);

  /* "asyncpg/protocol/protocol.pyx":95
 *         self.last_query = None
 * 
 *         self.closing = False             # <<<<<<<<<<<<<<
 *         self.is_reading = True
 *         self.writing_allowed = asyncio.Event()
*/
  __pyx_v_self->closing = 0;

  /* "asyncpg/protocol/protocol.pyx":96
 * 
 *         self.closing = False
 *         self.is_reading = True             # <<<<<<<<<<<<<<
 *         self.writing_allowed = asyncio.Event()
 *         self.writing_allowed.set()
*/
  __pyx_v_self->is_reading = 1;

  /* "asyncpg/protocol/protocol.pyx":97
 *         self.closing = False
 *         self.is_reading = True
 *         self.writing_allowed = asyncio.Event()             # <<<<<<<<<<<<<<
 *         self.writing_allowed.set()
 * 
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed, __pyx_t_1) < (0)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":98
 *         self.is_reading = True
 *         self.writing_allowed = asyncio.Event()
 *         self.writing_allowed.set()             # <<<<<<<<<<<<<<
 * 
 *         self.timeout_handle = None
*/
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":100
 *         self.writing_allowed.set()
 * 
 *         self.timeout_handle = None             # <<<<<<<<<<<<<<
 * 
 *         self.queries_count = 0
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->timeout_handle);
  __Pyx_DECREF(__pyx_v_self->timeout_handle);
  __pyx_v_self->timeout_handle = Py_None;

  /* "asyncpg/protocol/protocol.pyx":102
 *         self.timeout_handle = None
 * 
 *         self.queries_count = 0             # <<<<<<<<<<<<<<
 * 
 *         self._is_ssl = False
*/
  __pyx_v_self->queries_count = 0;

  /* "asyncpg/protocol/protocol.pyx":104
 *         self.queries_count = 0
 * 
 *         self._is_ssl = False             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  __pyx_v_self->_is_ssl = 0;

  /* "asyncpg/protocol/protocol.pyx":106
 *         self._is_ssl = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = loop.create_future
 *         except AttributeError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "asyncpg/protocol/protocol.pyx":107
 * 
 *         try:
 *             self.create_future = loop.create_future             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             self.create_future = self._create_future_fallback
*/
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_mstate_global->__pyx_n_u_create_future); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->create_future);
      __Pyx_DECREF(__pyx_v_self->create_future);
      __pyx_v_self->create_future = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/protocol.pyx":106
 *         self._is_ssl = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = loop.create_future
 *         except AttributeError:
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/protocol.pyx":108
 *         try:
 *             self.create_future = loop.create_future
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             self.create_future = self._create_future_fallback
 * 
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "asyncpg/protocol/protocol.pyx":109
 *             self.create_future = loop.create_future
 *         except AttributeError:
 *             self.create_future = self._create_future_fallback             # <<<<<<<<<<<<<<
 * 
 *     def set_connection(self, connection):
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_create_future_fallback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->create_future);
      __Pyx_DECREF(__pyx_v_self->create_future);
      __pyx_v_self->create_future = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "asyncpg/protocol/protocol.pyx":106
 *         self._is_ssl = False
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self.create_future = loop.create_future
 *         except AttributeError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L8_try_end:;
  }

  /* "asyncpg/protocol/protocol.pyx":77
 * 
 * cdef class BaseProtocol(CoreProtocol):
 *     def __init__(self, addr, connected_fut, con_params, record_class: type, loop):             # <<<<<<<<<<<<<<
 *         # type of `con_params` is `_ConnectionParameters`
 *         CoreProtocol.__init__(self, addr, con_params)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":111
 *             self.create_future = self._create_future_fallback
 * 
 *     def set_connection(self, connection):             # <<<<<<<<<<<<<<
 *         self.conref = weakref.ref(connection)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection = {"set_connection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_connection = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_connection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_connection,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 111, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 111, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_connection", 0) < (0)) __PYX_ERR(0, 111, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_connection", 1, 1, 1, i); __PYX_ERR(0, 111, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 111, __pyx_L3_error)
    }
    __pyx_v_connection = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_connection", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 111, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.set_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_connection);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_2set_connection(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_connection) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_connection", 0);

  /* "asyncpg/protocol/protocol.pyx":112
 * 
 *     def set_connection(self, connection):
 *         self.conref = weakref.ref(connection)             # <<<<<<<<<<<<<<
 * 
 *     cdef get_connection(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_weakref); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ref); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_connection};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->conref);
  __Pyx_DECREF(__pyx_v_self->conref);
  __pyx_v_self->conref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":111
 *             self.create_future = self._create_future_fallback
 * 
 *     def set_connection(self, connection):             # <<<<<<<<<<<<<<
 *         self.conref = weakref.ref(connection)
 * 
*/

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

/* "asyncpg/protocol/protocol.pyx":114
 *         self.conref = weakref.ref(connection)
 * 
 *     cdef get_connection(self):             # <<<<<<<<<<<<<<
 *         if self.conref is not None:
 *             return self.conref()
*/

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

  /* "asyncpg/protocol/protocol.pyx":115
 * 
 *     cdef get_connection(self):
 *         if self.conref is not None:             # <<<<<<<<<<<<<<
 *             return self.conref()
 *         else:
*/
  __pyx_t_1 = (__pyx_v_self->conref != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":116
 *     cdef get_connection(self):
 *         if self.conref is not None:
 *             return self.conref()             # <<<<<<<<<<<<<<
 *         else:
 *             return None
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_self->conref);
    __pyx_t_4 = __pyx_v_self->conref; 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":115
 * 
 *     cdef get_connection(self):
 *         if self.conref is not None:             # <<<<<<<<<<<<<<
 *             return self.conref()
 *         else:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":118
 *             return self.conref()
 *         else:
 *             return None             # <<<<<<<<<<<<<<
 * 
 *     def get_server_pid(self):
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/protocol.pyx":114
 *         self.conref = weakref.ref(connection)
 * 
 *     cdef get_connection(self):             # <<<<<<<<<<<<<<
 *         if self.conref is not None:
 *             return self.conref()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.get_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":120
 *             return None
 * 
 *     def get_server_pid(self):             # <<<<<<<<<<<<<<
 *         return self.backend_pid
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid = {"get_server_pid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_server_pid (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_server_pid", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_server_pid", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_4get_server_pid(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":121
 * 
 *     def get_server_pid(self):
 *         return self.backend_pid             # <<<<<<<<<<<<<<
 * 
 *     def get_settings(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":120
 *             return None
 * 
 *     def get_server_pid(self):             # <<<<<<<<<<<<<<
 *         return self.backend_pid
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.get_server_pid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":123
 *         return self.backend_pid
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return self.settings
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings = {"get_settings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_settings (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_settings", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_settings", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6get_settings(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_settings", 0);

  /* "asyncpg/protocol/protocol.pyx":124
 * 
 *     def get_settings(self):
 *         return self.settings             # <<<<<<<<<<<<<<
 * 
 *     def get_record_class(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->settings);
  __pyx_r = ((PyObject *)__pyx_v_self->settings);
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":123
 *         return self.backend_pid
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return self.settings
 * 
*/

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

/* "asyncpg/protocol/protocol.pyx":126
 *         return self.settings
 * 
 *     def get_record_class(self):             # <<<<<<<<<<<<<<
 *         return self.record_class
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class = {"get_record_class", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_record_class (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_record_class", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_record_class", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_8get_record_class(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_record_class", 0);

  /* "asyncpg/protocol/protocol.pyx":127
 * 
 *     def get_record_class(self):
 *         return self.record_class             # <<<<<<<<<<<<<<
 * 
 *     cdef inline resume_reading(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->record_class);
  __pyx_r = ((PyObject *)__pyx_v_self->record_class);
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":126
 *         return self.settings
 * 
 *     def get_record_class(self):             # <<<<<<<<<<<<<<
 *         return self.record_class
 * 
*/

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

/* "asyncpg/protocol/protocol.pyx":129
 *         return self.record_class
 * 
 *     cdef inline resume_reading(self):             # <<<<<<<<<<<<<<
 *         if not self.is_reading:
 *             self.is_reading = True
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resume_reading", 0);

  /* "asyncpg/protocol/protocol.pyx":130
 * 
 *     cdef inline resume_reading(self):
 *         if not self.is_reading:             # <<<<<<<<<<<<<<
 *             self.is_reading = True
 *             self.transport.resume_reading()
*/
  __pyx_t_1 = (!__pyx_v_self->is_reading);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":131
 *     cdef inline resume_reading(self):
 *         if not self.is_reading:
 *             self.is_reading = True             # <<<<<<<<<<<<<<
 *             self.transport.resume_reading()
 * 
*/
    __pyx_v_self->is_reading = 1;

    /* "asyncpg/protocol/protocol.pyx":132
 *         if not self.is_reading:
 *             self.is_reading = True
 *             self.transport.resume_reading()             # <<<<<<<<<<<<<<
 * 
 *     cdef inline pause_reading(self):
*/
    __pyx_t_3 = __pyx_v_self->__pyx_base.transport;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resume_reading, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":130
 * 
 *     cdef inline resume_reading(self):
 *         if not self.is_reading:             # <<<<<<<<<<<<<<
 *             self.is_reading = True
 *             self.transport.resume_reading()
*/
  }

  /* "asyncpg/protocol/protocol.pyx":129
 *         return self.record_class
 * 
 *     cdef inline resume_reading(self):             # <<<<<<<<<<<<<<
 *         if not self.is_reading:
 *             self.is_reading = True
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.resume_reading", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":134
 *             self.transport.resume_reading()
 * 
 *     cdef inline pause_reading(self):             # <<<<<<<<<<<<<<
 *         if self.is_reading:
 *             self.is_reading = False
*/

static CYTHON_INLINE PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pause_reading", 0);

  /* "asyncpg/protocol/protocol.pyx":135
 * 
 *     cdef inline pause_reading(self):
 *         if self.is_reading:             # <<<<<<<<<<<<<<
 *             self.is_reading = False
 *             self.transport.pause_reading()
*/
  if (__pyx_v_self->is_reading) {

    /* "asyncpg/protocol/protocol.pyx":136
 *     cdef inline pause_reading(self):
 *         if self.is_reading:
 *             self.is_reading = False             # <<<<<<<<<<<<<<
 *             self.transport.pause_reading()
 * 
*/
    __pyx_v_self->is_reading = 0;

    /* "asyncpg/protocol/protocol.pyx":137
 *         if self.is_reading:
 *             self.is_reading = False
 *             self.transport.pause_reading()             # <<<<<<<<<<<<<<
 * 
 *     async def prepare(self, stmt_name, query, timeout,
*/
    __pyx_t_2 = __pyx_v_self->__pyx_base.transport;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pause_reading, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":135
 * 
 *     cdef inline pause_reading(self):
 *         if self.is_reading:             # <<<<<<<<<<<<<<
 *             self.is_reading = False
 *             self.transport.pause_reading()
*/
  }

  /* "asyncpg/protocol/protocol.pyx":134
 *             self.transport.resume_reading()
 * 
 *     cdef inline pause_reading(self):             # <<<<<<<<<<<<<<
 *         if self.is_reading:
 *             self.is_reading = False
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.pause_reading", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare = {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_stmt_name = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_timeout = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_ignore_custom_codec = 0;
  PyObject *__pyx_v_record_class = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stmt_name,&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_record_class,&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_ignore_custom_codec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
    if (likely(__pyx_kwds_len > 0)) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prepare", 0) < (0)) __PYX_ERR(0, 139, __pyx_L3_error)

      /* "asyncpg/protocol/protocol.pyx":141
 *     async def prepare(self, stmt_name, query, timeout,
 *                       *,
 *                       PreparedStatementState state=None,             # <<<<<<<<<<<<<<
 *                       ignore_custom_codec=False,
 *                       record_class):
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None));

      /* "asyncpg/protocol/protocol.pyx":142
 *                       *,
 *                       PreparedStatementState state=None,
 *                       ignore_custom_codec=False,             # <<<<<<<<<<<<<<
 *                       record_class):
 *         if self.cancel_waiter is not None:
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, i); __PYX_ERR(0, 139, __pyx_L3_error) }
      }
      for (Py_ssize_t i = 3; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseKeywordRequired("prepare", *(__pyx_pyargnames[i - 0])); __PYX_ERR(0, 139, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      __Pyx_RaiseKeywordRequired("prepare", __pyx_mstate_global->__pyx_n_u_record_class); __PYX_ERR(0, 139, __pyx_L3_error)
    }
    __pyx_v_stmt_name = values[0];
    __pyx_v_query = values[1];
    __pyx_v_timeout = values[2];
    __pyx_v_record_class = values[3];
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[4]);
    __pyx_v_ignore_custom_codec = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prepare", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 139, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_stmt_name, __pyx_v_query, __pyx_v_timeout, __pyx_v_state, __pyx_v_ignore_custom_codec, __pyx_v_record_class);

  /* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_10prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_stmt_name, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_ignore_custom_codec, PyObject *__pyx_v_record_class) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 139, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_stmt_name = __pyx_v_stmt_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stmt_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stmt_name);
  __pyx_cur_scope->__pyx_v_query = __pyx_v_query;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_ignore_custom_codec = __pyx_v_ignore_custom_codec;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ignore_custom_codec);
  __pyx_cur_scope->__pyx_v_record_class = __pyx_v_record_class;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_record_class);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_record_class);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_mstate_global->__pyx_n_u_BaseProtocol_prepare, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 139, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prepare", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L29_resume_from_await;
    case 4: goto __pyx_L32_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 139, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":144
 *                       ignore_custom_codec=False,
 *                       record_class):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":145
 *                       record_class):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 145, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 145, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":144
 *                       ignore_custom_codec=False,
 *                       record_class):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":146
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":147
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 147, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":148
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":146
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":150
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":151
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":153
 *         timeout = self._get_timeout_impl(timeout)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._prepare_and_describe(stmt_name, query)  # network op
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":154
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":155
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._prepare_and_describe(stmt_name, query)  # network op             # <<<<<<<<<<<<<<
 *             self.last_query = query
 *             if state is None:
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_stmt_name;
        __Pyx_INCREF(__pyx_t_3);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 155, __pyx_L11_error)
        __pyx_t_7 = __pyx_cur_scope->__pyx_v_query;
        __Pyx_INCREF(__pyx_t_7);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(0, 155, __pyx_L11_error)
        __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._prepare_and_describe(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "asyncpg/protocol/protocol.pyx":156
 *         try:
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query             # <<<<<<<<<<<<<<
 *             if state is None:
 *                 state = PreparedStatementState(
*/
        __pyx_t_8 = __pyx_cur_scope->__pyx_v_query;
        __Pyx_INCREF(__pyx_t_8);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_8))) __PYX_ERR(0, 156, __pyx_L11_error)
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_8);
        __pyx_t_8 = 0;

        /* "asyncpg/protocol/protocol.pyx":157
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query
 *             if state is None:             # <<<<<<<<<<<<<<
 *                 state = PreparedStatementState(
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
*/
        __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_state) == Py_None);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/protocol.pyx":158
 *             self.last_query = query
 *             if state is None:
 *                 state = PreparedStatementState(             # <<<<<<<<<<<<<<
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
 *             self.statement = state
*/
          __pyx_t_7 = NULL;

          /* "asyncpg/protocol/protocol.pyx":159
 *             if state is None:
 *                 state = PreparedStatementState(
 *                     stmt_name, query, self, record_class, ignore_custom_codec)             # <<<<<<<<<<<<<<
 *             self.statement = state
 *         except Exception as ex:
*/
          __pyx_t_9 = 1;
          {
            PyObject *__pyx_callargs[6] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_stmt_name, __pyx_cur_scope->__pyx_v_query, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_record_class, __pyx_cur_scope->__pyx_v_ignore_custom_codec};
            __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 158, __pyx_L11_error)
            __Pyx_GOTREF((PyObject *)__pyx_t_8);
          }
          __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_state, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_8));
          __Pyx_GIVEREF((PyObject *)__pyx_t_8);
          __pyx_t_8 = 0;

          /* "asyncpg/protocol/protocol.pyx":157
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query
 *             if state is None:             # <<<<<<<<<<<<<<
 *                 state = PreparedStatementState(
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
*/
        }

        /* "asyncpg/protocol/protocol.pyx":160
 *                 state = PreparedStatementState(
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
 *             self.statement = state             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state;

        /* "asyncpg/protocol/protocol.pyx":154
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/protocol.pyx":161
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
 *             self.statement = state
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(0, 161, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_7;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":162
 *             self.statement = state
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_9 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "asyncpg/protocol/protocol.pyx":163
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":161
 *                     stmt_name, query, self, record_class, ignore_custom_codec)
 *             self.statement = state
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L24;
          }
          __pyx_L23_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_10 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L13_except_error;
          }
          __pyx_L24:;
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":154
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._prepare_and_describe(stmt_name, query)  # network op
 *             self.last_query = query
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":165
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def bind_execute(
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L29_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 165, __pyx_L1_error)
        __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_3 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 165, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_5);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_18);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_18;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L32_resume_from_await:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_18 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 165, __pyx_L31_error)
          __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_3 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 165, __pyx_L31_error)
        }
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L30_return;
      }
      __pyx_L30_return:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L0;
      __pyx_L31_error:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":167
 *             return await waiter
 * 
 *     async def bind_execute(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute = {"bind_execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_portal_name = 0;
  PyObject *__pyx_v_limit = 0;
  int __pyx_v_return_extra;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_return_extra,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_execute", 0) < (0)) __PYX_ERR(0, 167, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, i); __PYX_ERR(0, 167, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 167, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 167, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 167, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 167, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 167, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 167, __pyx_L3_error)
    }
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]);
    __pyx_v_args = values[1];
    __pyx_v_portal_name = ((PyObject*)values[2]);
    if (__Pyx_PyInt_FromNumber(&values[3], "limit", 0) < (0)) __PYX_ERR(0, 172, __pyx_L3_error)
    __pyx_v_limit = ((PyObject*)values[3]);
    __pyx_v_return_extra = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_return_extra == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error)
    __pyx_v_timeout = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bind_execute", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 169, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 2))) __PYX_ERR(0, 171, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_limit), (&PyLong_Type), 0, "limit", 2))) __PYX_ERR(0, 172, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13bind_execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_limit, int __pyx_v_return_extra, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bind_execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 167, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name);
  __pyx_cur_scope->__pyx_v_limit = __pyx_v_limit;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_limit);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_limit);
  __pyx_cur_scope->__pyx_v_return_extra = __pyx_v_return_extra;
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind_execute, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 167, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int32_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L29_resume_from_await;
    case 4: goto __pyx_L32_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 167, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":176
 *         timeout,
 *     ):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":177
 *     ):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 177, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 177, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":176
 *         timeout,
 *     ):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":178
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":179
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 179, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 179, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":180
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":178
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":182
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 *         args_buf = state._encode_bind_msg(args)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":183
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         args_buf = state._encode_bind_msg(args)
 * 
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":184
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)
 *         args_buf = state._encode_bind_msg(args)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":186
 *         args_buf = state._encode_bind_msg(args)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             if not state.prepared:
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":187
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":188
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             if not state.prepared:             # <<<<<<<<<<<<<<
 *                 self._send_parse_message(state.name, state.query)
 * 
*/
        __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_state->prepared);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/protocol.pyx":189
 *         try:
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)             # <<<<<<<<<<<<<<
 * 
 *             self._bind_execute(
*/
          __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query;
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_8 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._send_parse_message(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "asyncpg/protocol/protocol.pyx":188
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             if not state.prepared:             # <<<<<<<<<<<<<<
 *                 self._send_parse_message(state.name, state.query)
 * 
*/
        }

        /* "asyncpg/protocol/protocol.pyx":193
 *             self._bind_execute(
 *                 portal_name,
 *                 state.name,             # <<<<<<<<<<<<<<
 *                 args_buf,
 *                 limit)  # network op
*/
        __pyx_t_8 = __pyx_cur_scope->__pyx_v_state->name;
        __Pyx_INCREF(__pyx_t_8);

        /* "asyncpg/protocol/protocol.pyx":194
 *                 portal_name,
 *                 state.name,
 *                 args_buf,             # <<<<<<<<<<<<<<
 *                 limit)  # network op
 * 
*/
        if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 194, __pyx_L11_error)

        /* "asyncpg/protocol/protocol.pyx":195
 *                 state.name,
 *                 args_buf,
 *                 limit)  # network op             # <<<<<<<<<<<<<<
 * 
 *             self.last_query = state.query
*/
        __pyx_t_9 = __Pyx_PyLong_As_int32_t(__pyx_cur_scope->__pyx_v_limit); if (unlikely((__pyx_t_9 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L11_error)

        /* "asyncpg/protocol/protocol.pyx":191
 *                 self._send_parse_message(state.name, state.query)
 * 
 *             self._bind_execute(             # <<<<<<<<<<<<<<
 *                 portal_name,
 *                 state.name,
*/
        __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_8), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf), __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":197
 *                 limit)  # network op
 * 
 *             self.last_query = state.query             # <<<<<<<<<<<<<<
 *             self.statement = state
 *             self.return_extra = return_extra
*/
        __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query;
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":198
 * 
 *             self.last_query = state.query
 *             self.statement = state             # <<<<<<<<<<<<<<
 *             self.return_extra = return_extra
 *             self.queries_count += 1
*/
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state;

        /* "asyncpg/protocol/protocol.pyx":199
 *             self.last_query = state.query
 *             self.statement = state
 *             self.return_extra = return_extra             # <<<<<<<<<<<<<<
 *             self.queries_count += 1
 *         except Exception as ex:
*/
        __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_cur_scope->__pyx_v_return_extra;

        /* "asyncpg/protocol/protocol.pyx":200
 *             self.statement = state
 *             self.return_extra = return_extra
 *             self.queries_count += 1             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1);

        /* "asyncpg/protocol/protocol.pyx":187
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/protocol.pyx":201
 *             self.return_extra = return_extra
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_10) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_3) < 0) __PYX_ERR(0, 201, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_8;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":202
 *             self.queries_count += 1
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_13 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 202, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "asyncpg/protocol/protocol.pyx":203
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":201
 *             self.return_extra = return_extra
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L24;
          }
          __pyx_L23_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_10 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L13_except_error;
          }
          __pyx_L24:;
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":187
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":205
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def bind_execute_many(
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L29_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 205, __pyx_L1_error)
        __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_3 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 205, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
      if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_5);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_t_21);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_21;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L32_resume_from_await:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_21 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_21);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 205, __pyx_L31_error)
          __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_3 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 205, __pyx_L31_error)
        }
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L30_return;
      }
      __pyx_L30_return:;
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      goto __pyx_L0;
      __pyx_L31_error:;
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":167
 *             return await waiter
 * 
 *     async def bind_execute(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("bind_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":207
 *             return await waiter
 * 
 *     async def bind_execute_many(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many = {"bind_execute_many", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_portal_name = 0;
  PyObject *__pyx_v_timeout = 0;
  int __pyx_v_return_rows;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_execute_many (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_return_rows,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 207, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 207, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind_execute_many", 0) < (0)) __PYX_ERR(0, 207, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, i); __PYX_ERR(0, 207, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 207, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 207, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 207, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 207, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 207, __pyx_L3_error)
    }
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]);
    __pyx_v_args = values[1];
    __pyx_v_portal_name = ((PyObject*)values[2]);
    __pyx_v_timeout = values[3];
    __pyx_v_return_rows = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_return_rows == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bind_execute_many", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 207, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 0, "state", 0))) __PYX_ERR(0, 209, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 0, "portal_name", 2))) __PYX_ERR(0, 211, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_timeout, __pyx_v_return_rows);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":228
 *         # this generator expression to keep the memory pressure under
 *         # control.
 *         data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args))             # <<<<<<<<<<<<<<
 *         arg_bufs = iter(data_gen)
 * 
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 228, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_bind_execute_many_locals_genexpr, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

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

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 228, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 228, __pyx_L1_error) }
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
    __pyx_t_2 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 228, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_b);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_b, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state)) { __Pyx_RaiseClosureNameError("state"); __PYX_ERR(0, 228, __pyx_L1_error) }
    __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
    __pyx_t_7.__pyx_n = 1;
    __pyx_t_7.seqno = __pyx_t_6;
    __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_b, &__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 228, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

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

/* "asyncpg/protocol/protocol.pyx":207
 *             return await waiter
 * 
 *     async def bind_execute_many(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_16bind_execute_many(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout, int __pyx_v_return_rows) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_cur_scope;
  PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bind_execute_many", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 207, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  __pyx_cur_scope->__pyx_v_return_rows = __pyx_v_return_rows;
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind_execute_many, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute_many, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XDECREF(__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_2generator17);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind_execute_many", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L34_resume_from_await;
    case 4: goto __pyx_L35_resume_from_await;
    case 5: goto __pyx_L63_resume_from_await;
    case 6: goto __pyx_L66_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 207, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":215
 *         return_rows: bool,
 *     ):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":216
 *     ):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 216, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 216, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":215
 *         return_rows: bool,
 *     ):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":217
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":218
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 218, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 218, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":219
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":217
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":221
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 *         timer = Timer(timeout)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":222
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         timer = Timer(timeout)
 * 
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":223
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)
 *         timer = Timer(timeout)             # <<<<<<<<<<<<<<
 * 
 *         # Make sure the argument sequence is encoded lazily with
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_timer = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":228
 *         # this generator expression to keep the memory pressure under
 *         # control.
 *         data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args))             # <<<<<<<<<<<<<<
 *         arg_bufs = iter(data_gen)
 * 
*/
  __pyx_t_3 = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_data_gen = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":229
 *         # control.
 *         data_gen = (state._encode_bind_msg(b, i) for i, b in enumerate(args))
 *         arg_bufs = iter(data_gen)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_data_gen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_arg_bufs = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":231
 *         arg_bufs = iter(data_gen)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             if not state.prepared:
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":232
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":233
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             if not state.prepared:             # <<<<<<<<<<<<<<
 *                 self._send_parse_message(state.name, state.query)
 * 
*/
        __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_state->prepared);
        if (__pyx_t_1) {

          /* "asyncpg/protocol/protocol.pyx":234
 *         try:
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)             # <<<<<<<<<<<<<<
 * 
 *             more = self._bind_execute_many(
*/
          __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_5 = __pyx_cur_scope->__pyx_v_state->query;
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._send_parse_message(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "asyncpg/protocol/protocol.pyx":233
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             if not state.prepared:             # <<<<<<<<<<<<<<
 *                 self._send_parse_message(state.name, state.query)
 * 
*/
        }

        /* "asyncpg/protocol/protocol.pyx":238
 *             more = self._bind_execute_many(
 *                 portal_name,
 *                 state.name,             # <<<<<<<<<<<<<<
 *                 arg_bufs,
 *                 return_rows)  # network op
*/
        __pyx_t_4 = __pyx_cur_scope->__pyx_v_state->name;
        __Pyx_INCREF(__pyx_t_4);

        /* "asyncpg/protocol/protocol.pyx":236
 *                 self._send_parse_message(state.name, state.query)
 * 
 *             more = self._bind_execute_many(             # <<<<<<<<<<<<<<
 *                 portal_name,
 *                 state.name,
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_4), __pyx_cur_scope->__pyx_v_arg_bufs, __pyx_cur_scope->__pyx_v_return_rows); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_cur_scope->__pyx_v_more = __pyx_t_1;

        /* "asyncpg/protocol/protocol.pyx":242
 *                 return_rows)  # network op
 * 
 *             self.last_query = state.query             # <<<<<<<<<<<<<<
 *             self.statement = state
 *             self.return_extra = False
*/
        __pyx_t_4 = __pyx_cur_scope->__pyx_v_state->query;
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;

        /* "asyncpg/protocol/protocol.pyx":243
 * 
 *             self.last_query = state.query
 *             self.statement = state             # <<<<<<<<<<<<<<
 *             self.return_extra = False
 *             self.queries_count += 1
*/
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state;

        /* "asyncpg/protocol/protocol.pyx":244
 *             self.last_query = state.query
 *             self.statement = state
 *             self.return_extra = False             # <<<<<<<<<<<<<<
 *             self.queries_count += 1
 * 
*/
        __pyx_cur_scope->__pyx_v_self->return_extra = 0;

        /* "asyncpg/protocol/protocol.pyx":245
 *             self.statement = state
 *             self.return_extra = False
 *             self.queries_count += 1             # <<<<<<<<<<<<<<
 * 
 *             while more:
*/
        __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1);

        /* "asyncpg/protocol/protocol.pyx":247
 *             self.queries_count += 1
 * 
 *             while more:             # <<<<<<<<<<<<<<
 *                 with timer:
 *                     await compat.wait_for(
*/
        while (1) {
          if (!__pyx_cur_scope->__pyx_v_more) break;

          /* "asyncpg/protocol/protocol.pyx":248
 * 
 *             while more:
 *                 with timer:             # <<<<<<<<<<<<<<
 *                     await compat.wait_for(
 *                         self.writing_allowed.wait(),
*/
          /*with:*/ {
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 248, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_5 = NULL;
            __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L20_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__pyx_t_5);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_5);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
              __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            /*try:*/ {
              {
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                /*try:*/ {

                  /* "asyncpg/protocol/protocol.pyx":249
 *             while more:
 *                 with timer:
 *                     await compat.wait_for(             # <<<<<<<<<<<<<<
 *                         self.writing_allowed.wait(),
 *                         timeout=timer.get_remaining_budget())
*/
                  __pyx_t_3 = NULL;
                  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_5);
                  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 249, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_14);
                  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                  /* "asyncpg/protocol/protocol.pyx":250
 *                 with timer:
 *                     await compat.wait_for(
 *                         self.writing_allowed.wait(),             # <<<<<<<<<<<<<<
 *                         timeout=timer.get_remaining_budget())
 *                     # On Windows the above event somehow won't allow context
*/
                  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 250, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_16);
                  __pyx_t_15 = __pyx_t_16;
                  __Pyx_INCREF(__pyx_t_15);
                  __pyx_t_6 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
                    __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_5);
                  }

                  /* "asyncpg/protocol/protocol.pyx":251
 *                     await compat.wait_for(
 *                         self.writing_allowed.wait(),
 *                         timeout=timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 *                     # On Windows the above event somehow won't allow context
 *                     # switch, so forcing one with sleep(0) here
*/
                  __pyx_t_15 = __pyx_cur_scope->__pyx_v_timer;
                  __Pyx_INCREF(__pyx_t_15);
                  __pyx_t_6 = 0;
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
                    __pyx_t_16 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 251, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_16);
                  }
                  __pyx_t_6 = 1;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_14))) {
                    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14);
                    assert(__pyx_t_3);
                    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
                    __Pyx_INCREF(__pyx_t_3);
                    __Pyx_INCREF(__pyx__function);
                    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
                    __pyx_t_6 = 0;
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_5};
                    __pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 249, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_15);
                    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_16, __pyx_t_15, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 249, __pyx_L26_error)
                    __pyx_t_4 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_15);
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_4);
                  }
                  __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4, &__pyx_r);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                    __Pyx_GOTREF(__pyx_r);
                    __Pyx_XGIVEREF(__pyx_t_7);
                    __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                    __Pyx_XGIVEREF(__pyx_t_8);
                    __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                    __Pyx_XGIVEREF(__pyx_t_9);
                    __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                    __Pyx_XGIVEREF(__pyx_t_10);
                    __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
                    __Pyx_XGIVEREF(__pyx_t_11);
                    __pyx_cur_scope->__pyx_t_4 = __pyx_t_11;
                    __Pyx_XGIVEREF(__pyx_t_12);
                    __pyx_cur_scope->__pyx_t_5 = __pyx_t_12;
                    __Pyx_XGIVEREF(__pyx_t_13);
                    __pyx_cur_scope->__pyx_t_6 = __pyx_t_13;
                    __Pyx_XGIVEREF(__pyx_r);
                    __Pyx_RefNannyFinishContext();
                    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                    /* return from generator, awaiting value */
                    __pyx_generator->resume_label = 3;
                    return __pyx_r;
                    __pyx_L34_resume_from_await:;
                    __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                    __pyx_cur_scope->__pyx_t_0 = 0;
                    __Pyx_XGOTREF(__pyx_t_7);
                    __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                    __pyx_cur_scope->__pyx_t_1 = 0;
                    __Pyx_XGOTREF(__pyx_t_8);
                    __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                    __pyx_cur_scope->__pyx_t_2 = 0;
                    __Pyx_XGOTREF(__pyx_t_9);
                    __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
                    __pyx_cur_scope->__pyx_t_3 = 0;
                    __Pyx_XGOTREF(__pyx_t_10);
                    __pyx_t_11 = __pyx_cur_scope->__pyx_t_4;
                    __pyx_cur_scope->__pyx_t_4 = 0;
                    __Pyx_XGOTREF(__pyx_t_11);
                    __pyx_t_12 = __pyx_cur_scope->__pyx_t_5;
                    __pyx_cur_scope->__pyx_t_5 = 0;
                    __Pyx_XGOTREF(__pyx_t_12);
                    __pyx_t_13 = __pyx_cur_scope->__pyx_t_6;
                    __pyx_cur_scope->__pyx_t_6 = 0;
                    __Pyx_XGOTREF(__pyx_t_13);
                    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 249, __pyx_L26_error)
                  } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                    __Pyx_GOTREF(__pyx_r);
                    __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                  } else {
                    __Pyx_XGOTREF(__pyx_r);
                    __PYX_ERR(0, 249, __pyx_L26_error)
                  }

                  /* "asyncpg/protocol/protocol.pyx":254
 *                     # On Windows the above event somehow won't allow context
 *                     # switch, so forcing one with sleep(0) here
 *                     await asyncio.sleep(0)             # <<<<<<<<<<<<<<
 *                 if not timer.has_budget_greater_than(0):
 *                     raise asyncio.TimeoutError
*/
                  __pyx_t_14 = NULL;
                  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 254, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 254, __pyx_L26_error)
                  __Pyx_GOTREF(__pyx_t_16);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __pyx_t_6 = 1;
                  #if CYTHON_UNPACK_METHODS
                  if (unlikely(PyMethod_Check(__pyx_t_16))) {
                    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_16);
                    assert(__pyx_t_14);
                    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
                    __Pyx_INCREF(__pyx_t_14);
                    __Pyx_INCREF(__pyx__function);
                    __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
                    __pyx_t_6 = 0;
                  }
                  #endif
                  {
                    PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_mstate_global->__pyx_int_0};
                    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L26_error)
                    __Pyx_GOTREF(__pyx_t_4);
                  }
                  __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4, &__pyx_r);
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                    __Pyx_GOTREF(__pyx_r);
                    __Pyx_XGIVEREF(__pyx_t_7);
                    __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                    __Pyx_XGIVEREF(__pyx_t_8);
                    __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                    __Pyx_XGIVEREF(__pyx_t_9);
                    __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                    __Pyx_XGIVEREF(__pyx_t_10);
                    __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
                    __Pyx_XGIVEREF(__pyx_t_11);
                    __pyx_cur_scope->__pyx_t_4 = __pyx_t_11;
                    __Pyx_XGIVEREF(__pyx_t_12);
                    __pyx_cur_scope->__pyx_t_5 = __pyx_t_12;
                    __Pyx_XGIVEREF(__pyx_t_13);
                    __pyx_cur_scope->__pyx_t_6 = __pyx_t_13;
                    __Pyx_XGIVEREF(__pyx_r);
                    __Pyx_RefNannyFinishContext();
                    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                    /* return from generator, awaiting value */
                    __pyx_generator->resume_label = 4;
                    return __pyx_r;
                    __pyx_L35_resume_from_await:;
                    __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                    __pyx_cur_scope->__pyx_t_0 = 0;
                    __Pyx_XGOTREF(__pyx_t_7);
                    __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                    __pyx_cur_scope->__pyx_t_1 = 0;
                    __Pyx_XGOTREF(__pyx_t_8);
                    __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                    __pyx_cur_scope->__pyx_t_2 = 0;
                    __Pyx_XGOTREF(__pyx_t_9);
                    __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
                    __pyx_cur_scope->__pyx_t_3 = 0;
                    __Pyx_XGOTREF(__pyx_t_10);
                    __pyx_t_11 = __pyx_cur_scope->__pyx_t_4;
                    __pyx_cur_scope->__pyx_t_4 = 0;
                    __Pyx_XGOTREF(__pyx_t_11);
                    __pyx_t_12 = __pyx_cur_scope->__pyx_t_5;
                    __pyx_cur_scope->__pyx_t_5 = 0;
                    __Pyx_XGOTREF(__pyx_t_12);
                    __pyx_t_13 = __pyx_cur_scope->__pyx_t_6;
                    __pyx_cur_scope->__pyx_t_6 = 0;
                    __Pyx_XGOTREF(__pyx_t_13);
                    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 254, __pyx_L26_error)
                  } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                    __Pyx_GOTREF(__pyx_r);
                    __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                  } else {
                    __Pyx_XGOTREF(__pyx_r);
                    __PYX_ERR(0, 254, __pyx_L26_error)
                  }

                  /* "asyncpg/protocol/protocol.pyx":248
 * 
 *             while more:
 *                 with timer:             # <<<<<<<<<<<<<<
 *                     await compat.wait_for(
 *                         self.writing_allowed.wait(),
*/
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L33_try_end;
                __pyx_L26_error:;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_16, &__pyx_t_14) < 0) __PYX_ERR(0, 248, __pyx_L28_except_error)
                  __Pyx_XGOTREF(__pyx_t_4);
                  __Pyx_XGOTREF(__pyx_t_16);
                  __Pyx_XGOTREF(__pyx_t_14);
                  __pyx_t_15 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_16, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 248, __pyx_L28_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 248, __pyx_L28_except_error)
                  __Pyx_GOTREF(__pyx_t_17);
                  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_17);
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  if (__pyx_t_1 < (0)) __PYX_ERR(0, 248, __pyx_L28_except_error)
                  __pyx_t_18 = (!__pyx_t_1);
                  if (unlikely(__pyx_t_18)) {
                    __Pyx_GIVEREF(__pyx_t_4);
                    __Pyx_GIVEREF(__pyx_t_16);
                    __Pyx_XGIVEREF(__pyx_t_14);
                    __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_16, __pyx_t_14);
                    __pyx_t_4 = 0;  __pyx_t_16 = 0;  __pyx_t_14 = 0; 
                    __PYX_ERR(0, 248, __pyx_L28_except_error)
                  }
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  goto __pyx_L27_exception_handled;
                }
                __pyx_L28_except_error:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                goto __pyx_L11_error;
                __pyx_L27_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                __pyx_L33_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 248, __pyx_L11_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                }
                goto __pyx_L25;
              }
              __pyx_L25:;
            }
            goto __pyx_L39;
            __pyx_L20_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L11_error;
            __pyx_L39:;
          }

          /* "asyncpg/protocol/protocol.pyx":255
 *                     # switch, so forcing one with sleep(0) here
 *                     await asyncio.sleep(0)
 *                 if not timer.has_budget_greater_than(0):             # <<<<<<<<<<<<<<
 *                     raise asyncio.TimeoutError
 *                 more = self._bind_execute_many_more()  # network op
*/
          __pyx_t_16 = __pyx_cur_scope->__pyx_v_timer;
          __Pyx_INCREF(__pyx_t_16);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_mstate_global->__pyx_int_0};
            __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_has_budget_greater_than, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 255, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_14);
          }
          __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 255, __pyx_L11_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_1 = (!__pyx_t_18);
          if (unlikely(__pyx_t_1)) {

            /* "asyncpg/protocol/protocol.pyx":256
 *                     await asyncio.sleep(0)
 *                 if not timer.has_budget_greater_than(0):
 *                     raise asyncio.TimeoutError             # <<<<<<<<<<<<<<
 *                 more = self._bind_execute_many_more()  # network op
 * 
*/
            __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 256, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 256, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_Raise(__pyx_t_16, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(0, 256, __pyx_L11_error)

            /* "asyncpg/protocol/protocol.pyx":255
 *                     # switch, so forcing one with sleep(0) here
 *                     await asyncio.sleep(0)
 *                 if not timer.has_budget_greater_than(0):             # <<<<<<<<<<<<<<
 *                     raise asyncio.TimeoutError
 *                 more = self._bind_execute_many_more()  # network op
*/
          }

          /* "asyncpg/protocol/protocol.pyx":257
 *                 if not timer.has_budget_greater_than(0):
 *                     raise asyncio.TimeoutError
 *                 more = self._bind_execute_many_more()  # network op             # <<<<<<<<<<<<<<
 * 
 *         except asyncio.TimeoutError as e:
*/
          __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many_more(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L11_error)
          __pyx_cur_scope->__pyx_v_more = __pyx_t_1;
        }

        /* "asyncpg/protocol/protocol.pyx":232
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/protocol.pyx":259
 *                 more = self._bind_execute_many_more()  # network op
 * 
 *         except asyncio.TimeoutError as e:             # <<<<<<<<<<<<<<
 *             self._bind_execute_many_fail(e)  # network op
 * 
*/
      __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_14, &__pyx_t_4);
      __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 259, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_19 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_16, __pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_ErrRestore(__pyx_t_16, __pyx_t_14, __pyx_t_4);
      __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_4 = 0;
      if (__pyx_t_19) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_14, &__pyx_t_16) < 0) __PYX_ERR(0, 259, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_cur_scope->__pyx_v_e = __pyx_t_14;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":260
 * 
 *         except asyncio.TimeoutError as e:
 *             self._bind_execute_many_fail(e)  # network op             # <<<<<<<<<<<<<<
 * 
 *         except Exception as ex:
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind_execute_many_fail(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_e, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L46_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":259
 *                 more = self._bind_execute_many_more()  # network op
 * 
 *         except asyncio.TimeoutError as e:             # <<<<<<<<<<<<<<
 *             self._bind_execute_many_fail(e)  # network op
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0;
            goto __pyx_L47;
          }
          __pyx_L46_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_17, &__pyx_t_22);
            if ( unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_19 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_17, __pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ErrRestore(__pyx_t_10, __pyx_t_13, __pyx_t_12);
            __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_17 = 0; __pyx_t_22 = 0;
            __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
            goto __pyx_L13_except_error;
          }
          __pyx_L47:;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        goto __pyx_L12_exception_handled;
      }

      /* "asyncpg/protocol/protocol.pyx":262
 *             self._bind_execute_many_fail(e)  # network op
 * 
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_20 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_20) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_14, &__pyx_t_4) < 0) __PYX_ERR(0, 262, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_14;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":263
 * 
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_15 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_15);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L57_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/protocol.pyx":264
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L57_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":262
 *             self._bind_execute_many_fail(e)  # network op
 * 
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L58;
          }
          __pyx_L57_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_22 = 0; __pyx_t_17 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_10);
            if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_17, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_17, &__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_10);
            __pyx_t_20 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ErrRestore(__pyx_t_22, __pyx_t_17, __pyx_t_11);
            __pyx_t_22 = 0; __pyx_t_17 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_10 = 0;
            __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_23;
            goto __pyx_L13_except_error;
          }
          __pyx_L58:;
        }
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":232
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             if not state.prepared:
 *                 self._send_parse_message(state.name, state.query)
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":266
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def bind(self, PreparedStatementState state, args,
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 5;
        return __pyx_r;
        __pyx_L63_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 266, __pyx_L1_error)
        __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_4 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 266, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_13, &__pyx_t_12);
      if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_12);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_7);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
          __Pyx_XGIVEREF(__pyx_t_8);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
          __Pyx_XGIVEREF(__pyx_t_9);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
          __Pyx_XGIVEREF(__pyx_t_10);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
          __Pyx_XGIVEREF(__pyx_t_12);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_12;
          __Pyx_XGIVEREF(__pyx_t_13);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_13;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 6;
          return __pyx_r;
          __pyx_L66_resume_from_await:;
          __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_10);
          __pyx_t_12 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_13 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_13);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 266, __pyx_L65_error)
          __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_4 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 266, __pyx_L65_error)
        }
        __pyx_r = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L64_return;
      }
      __pyx_L64_return:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_13, __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
      goto __pyx_L0;
      __pyx_L65_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_13, __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":207
 *             return await waiter
 * 
 *     async def bind_execute_many(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("bind_execute_many", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":268
 *             return await waiter
 * 
 *     async def bind(self, PreparedStatementState state, args,             # <<<<<<<<<<<<<<
 *                    str portal_name, timeout):
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind = {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_portal_name = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bind", 0) < (0)) __PYX_ERR(0, 268, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, i); __PYX_ERR(0, 268, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 268, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 268, __pyx_L3_error)
    }
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]);
    __pyx_v_args = values[1];
    __pyx_v_portal_name = ((PyObject*)values[2]);
    __pyx_v_timeout = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bind", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 268, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 268, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 269, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_args, __pyx_v_portal_name, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_19bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_args, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bind", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 268, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_bind, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bind", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L28_resume_from_await;
    case 4: goto __pyx_L31_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 268, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":271
 *                    str portal_name, timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":272
 * 
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 272, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 272, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":271
 *                    str portal_name, timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":273
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":274
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 274, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 274, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":275
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":273
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":277
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 *         args_buf = state._encode_bind_msg(args)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":278
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         args_buf = state._encode_bind_msg(args)
 * 
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":279
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)
 *         args_buf = state._encode_bind_msg(args)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg(__pyx_cur_scope->__pyx_v_state, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_args_buf = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":281
 *         args_buf = state._encode_bind_msg(args)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._bind(
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":282
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._bind(
 *                 portal_name,
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":285
 *             self._bind(
 *                 portal_name,
 *                 state.name,             # <<<<<<<<<<<<<<
 *                 args_buf)  # network op
 * 
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name;
        __Pyx_INCREF(__pyx_t_3);

        /* "asyncpg/protocol/protocol.pyx":286
 *                 portal_name,
 *                 state.name,
 *                 args_buf)  # network op             # <<<<<<<<<<<<<<
 * 
 *             self.last_query = state.query
*/
        if (!(likely(((__pyx_cur_scope->__pyx_v_args_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_args_buf, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(0, 286, __pyx_L11_error)

        /* "asyncpg/protocol/protocol.pyx":283
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._bind(             # <<<<<<<<<<<<<<
 *                 portal_name,
 *                 state.name,
*/
        __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._bind(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, ((PyObject*)__pyx_t_3), ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_args_buf)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":288
 *                 args_buf)  # network op
 * 
 *             self.last_query = state.query             # <<<<<<<<<<<<<<
 *             self.statement = state
 *         except Exception as ex:
*/
        __pyx_t_7 = __pyx_cur_scope->__pyx_v_state->query;
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_7);
        __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":289
 * 
 *             self.last_query = state.query
 *             self.statement = state             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state;

        /* "asyncpg/protocol/protocol.pyx":282
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._bind(
 *                 portal_name,
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "asyncpg/protocol/protocol.pyx":290
 *             self.last_query = state.query
 *             self.statement = state
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_8) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 290, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_3;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":291
 *             self.statement = state
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_12 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 291, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "asyncpg/protocol/protocol.pyx":292
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":290
 *             self.last_query = state.query
 *             self.statement = state
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L23;
          }
          __pyx_L22_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L13_except_error;
          }
          __pyx_L23:;
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":282
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._bind(
 *                 portal_name,
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":294
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def execute(self, PreparedStatementState state,
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L28_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 294, __pyx_L1_error)
        __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_9 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 294, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_5);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_18);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_18;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L31_resume_from_await:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_18 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 294, __pyx_L30_error)
          __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_9 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 294, __pyx_L30_error)
        }
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L29_return;
      }
      __pyx_L29_return:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L0;
      __pyx_L30_error:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":268
 *             return await waiter
 * 
 *     async def bind(self, PreparedStatementState state, args,             # <<<<<<<<<<<<<<
 *                    str portal_name, timeout):
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":296
 *             return await waiter
 * 
 *     async def execute(self, PreparedStatementState state,             # <<<<<<<<<<<<<<
 *                       str portal_name, int limit, return_extra,
 *                       timeout):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute = {"execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_portal_name = 0;
  int __pyx_v_limit;
  PyObject *__pyx_v_return_extra = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_return_extra,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 296, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "execute", 0) < (0)) __PYX_ERR(0, 296, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, i); __PYX_ERR(0, 296, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 296, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 296, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 296, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 296, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 296, __pyx_L3_error)
    }
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]);
    __pyx_v_portal_name = ((PyObject*)values[1]);
    __pyx_v_limit = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L3_error)
    __pyx_v_return_extra = values[3];
    __pyx_v_timeout = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 296, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 296, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 297, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_portal_name, __pyx_v_limit, __pyx_v_return_extra, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_22execute(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_portal_name, int __pyx_v_limit, PyObject *__pyx_v_return_extra, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 296, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name);
  __pyx_cur_scope->__pyx_v_limit = __pyx_v_limit;
  __pyx_cur_scope->__pyx_v_return_extra = __pyx_v_return_extra;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_extra);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_extra);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_execute, __pyx_mstate_global->__pyx_n_u_BaseProtocol_execute, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L28_resume_from_await;
    case 4: goto __pyx_L31_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 296, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":300
 *                       timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":301
 * 
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 301, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 301, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":300
 *                       timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":302
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":303
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 303, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 303, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":304
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":302
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":306
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":307
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":309
 *         timeout = self._get_timeout_impl(timeout)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._execute(
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":310
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._execute(
 *                 portal_name,
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":311
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._execute(             # <<<<<<<<<<<<<<
 *                 portal_name,
 *                 limit)  # network op
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._execute(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, __pyx_cur_scope->__pyx_v_limit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":315
 *                 limit)  # network op
 * 
 *             self.last_query = state.query             # <<<<<<<<<<<<<<
 *             self.statement = state
 *             self.return_extra = return_extra
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->query;
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":316
 * 
 *             self.last_query = state.query
 *             self.statement = state             # <<<<<<<<<<<<<<
 *             self.return_extra = return_extra
 *             self.queries_count += 1
*/
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_self->statement);
        __pyx_cur_scope->__pyx_v_self->statement = __pyx_cur_scope->__pyx_v_state;

        /* "asyncpg/protocol/protocol.pyx":317
 *             self.last_query = state.query
 *             self.statement = state
 *             self.return_extra = return_extra             # <<<<<<<<<<<<<<
 *             self.queries_count += 1
 *         except Exception as ex:
*/
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_extra); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 317, __pyx_L11_error)
        __pyx_cur_scope->__pyx_v_self->return_extra = __pyx_t_1;

        /* "asyncpg/protocol/protocol.pyx":318
 *             self.statement = state
 *             self.return_extra = return_extra
 *             self.queries_count += 1             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1);

        /* "asyncpg/protocol/protocol.pyx":310
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._execute(
 *                 portal_name,
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/protocol.pyx":319
 *             self.return_extra = return_extra
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 319, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_8;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":320
 *             self.queries_count += 1
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_12 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "asyncpg/protocol/protocol.pyx":321
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 321, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":319
 *             self.return_extra = return_extra
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L23;
          }
          __pyx_L22_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L13_except_error;
          }
          __pyx_L23:;
        }
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":310
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._execute(
 *                 portal_name,
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":323
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def close_portal(self, str portal_name, timeout):
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L28_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 323, __pyx_L1_error)
        __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_9 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 323, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_5);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_18);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_18;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L31_resume_from_await:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_18 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 323, __pyx_L30_error)
          __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_9 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 323, __pyx_L30_error)
        }
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L29_return;
      }
      __pyx_L29_return:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L0;
      __pyx_L30_error:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":296
 *             return await waiter
 * 
 *     async def execute(self, PreparedStatementState state,             # <<<<<<<<<<<<<<
 *                       str portal_name, int limit, return_extra,
 *                       timeout):
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":325
 *             return await waiter
 * 
 *     async def close_portal(self, str portal_name, timeout):             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal = {"close_portal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_portal_name = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_portal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_portal_name,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 325, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 325, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 325, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close_portal", 0) < (0)) __PYX_ERR(0, 325, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close_portal", 1, 2, 2, i); __PYX_ERR(0, 325, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 325, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 325, __pyx_L3_error)
    }
    __pyx_v_portal_name = ((PyObject*)values[0]);
    __pyx_v_timeout = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("close_portal", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 325, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_portal_name), (&PyUnicode_Type), 1, "portal_name", 1))) __PYX_ERR(0, 325, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_portal_name, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_25close_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_portal_name, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_portal", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 325, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_portal_name = __pyx_v_portal_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_portal_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_portal_name);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_portal, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_portal", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L28_resume_from_await;
    case 4: goto __pyx_L31_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 325, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":327
 *     async def close_portal(self, str portal_name, timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":328
 * 
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 328, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 328, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":327
 *     async def close_portal(self, str portal_name, timeout):
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":329
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":330
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 330, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 330, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":331
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":329
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":333
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         timeout = self._get_timeout_impl(timeout)
 * 
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":334
 * 
 *         self._check_state()
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":336
 *         timeout = self._get_timeout_impl(timeout)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._close(
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":337
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(
 *                 portal_name,
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":338
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._close(             # <<<<<<<<<<<<<<
 *                 portal_name,
 *                 True)  # network op
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_portal_name, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":337
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(
 *                 portal_name,
*/
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/protocol.pyx":341
 *                 portal_name,
 *                 True)  # network op
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 341, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_8;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":342
 *                 True)  # network op
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_11 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_12 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "asyncpg/protocol/protocol.pyx":343
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_10 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 343, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":341
 *                 portal_name,
 *                 True)  # network op
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L23;
          }
          __pyx_L22_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_7 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L13_except_error;
          }
          __pyx_L23:;
        }
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":337
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(
 *                 portal_name,
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":345
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def query(self, query, timeout):
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L28_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 345, __pyx_L1_error)
        __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_9 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 345, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_5);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_18);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_18;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L31_resume_from_await:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_18 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 345, __pyx_L30_error)
          __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_9 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 345, __pyx_L30_error)
        }
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L29_return;
      }
      __pyx_L29_return:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L0;
      __pyx_L30_error:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":325
 *             return await waiter
 * 
 *     async def close_portal(self, str portal_name, timeout):             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("close_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":347
 *             return await waiter
 * 
 *     async def query(self, query, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_29query = {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_query,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 347, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "query", 0) < (0)) __PYX_ERR(0, 347, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, i); __PYX_ERR(0, 347, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 347, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 347, __pyx_L3_error)
    }
    __pyx_v_query = values[0];
    __pyx_v_timeout = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("query", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 347, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_query, __pyx_v_timeout);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_28query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("query", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 347, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_query = __pyx_v_query;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_query, __pyx_mstate_global->__pyx_n_u_BaseProtocol_query, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 347, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L28_resume_from_await;
    case 4: goto __pyx_L31_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 347, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":348
 * 
 *     async def query(self, query, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":349
 *     async def query(self, query, timeout):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 349, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 349, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":348
 * 
 *     async def query(self, query, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":350
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":351
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 351, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 351, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":352
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":350
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":354
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 *         # query() needs to call _get_timeout instead of _get_timeout_impl
 *         # for consistent validation, as it is called differently from
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":358
 *         # for consistent validation, as it is called differently from
 *         # prepare/bind/execute methods.
 *         timeout = self._get_timeout(timeout)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timeout)
*/
  __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_timeout, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":360
 *         timeout = self._get_timeout(timeout)
 * 
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._simple_query(query)  # network op
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":361
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._simple_query(query)  # network op
 *             self.last_query = query
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":362
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._simple_query(query)  # network op             # <<<<<<<<<<<<<<
 *             self.last_query = query
 *             self.queries_count += 1
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_query;
        __Pyx_INCREF(__pyx_t_3);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 362, __pyx_L11_error)
        __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._simple_query(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "asyncpg/protocol/protocol.pyx":363
 *         try:
 *             self._simple_query(query)  # network op
 *             self.last_query = query             # <<<<<<<<<<<<<<
 *             self.queries_count += 1
 *         except Exception as ex:
*/
        __pyx_t_4 = __pyx_cur_scope->__pyx_v_query;
        __Pyx_INCREF(__pyx_t_4);
        if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 363, __pyx_L11_error)
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->last_query);
        __pyx_cur_scope->__pyx_v_self->last_query = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;

        /* "asyncpg/protocol/protocol.pyx":364
 *             self._simple_query(query)  # network op
 *             self.last_query = query
 *             self.queries_count += 1             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __pyx_cur_scope->__pyx_v_self->queries_count = (__pyx_cur_scope->__pyx_v_self->queries_count + 1);

        /* "asyncpg/protocol/protocol.pyx":361
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._simple_query(query)  # network op
 *             self.last_query = query
*/
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L16_try_end;
      __pyx_L11_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/protocol.pyx":365
 *             self.last_query = query
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_10) < 0) __PYX_ERR(0, 365, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_3;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":366
 *             self.queries_count += 1
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_12 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 366, __pyx_L22_error)
            __Pyx_GOTREF(__pyx_t_11);
          }
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

          /* "asyncpg/protocol/protocol.pyx":367
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_11 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 367, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":365
 *             self.last_query = query
 *             self.queries_count += 1
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L23;
          }
          __pyx_L22_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __pyx_t_9 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
            __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
            goto __pyx_L13_except_error;
          }
          __pyx_L23:;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L12_exception_handled;
      }
      goto __pyx_L13_except_error;

      /* "asyncpg/protocol/protocol.pyx":361
 * 
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._simple_query(query)  # network op
 *             self.last_query = query
*/
      __pyx_L13_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L9_error;
      __pyx_L12_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L16_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":369
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L28_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 369, __pyx_L1_error)
        __pyx_t_10 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_10);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_10 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 369, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L0;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_19, &__pyx_t_18);
      if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_18);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_7);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
          __Pyx_XGIVEREF(__pyx_t_8);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
          __Pyx_XGIVEREF(__pyx_t_18);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_18;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L31_resume_from_await:;
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_18 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 369, __pyx_L30_error)
          __pyx_t_10 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_10);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_10 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 369, __pyx_L30_error)
        }
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L29_return;
      }
      __pyx_L29_return:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L0;
      __pyx_L30_error:;
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_19, __pyx_t_18);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":347
 *             return await waiter
 * 
 *     async def query(self, query, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":371
 *             return await waiter
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out = {"copy_out", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_copy_stmt = 0;
  PyObject *__pyx_v_sink = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_out (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_copy_stmt,&__pyx_mstate_global->__pyx_n_u_sink,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 371, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 371, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy_out", 0) < (0)) __PYX_ERR(0, 371, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, i); __PYX_ERR(0, 371, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 371, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 371, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 371, __pyx_L3_error)
    }
    __pyx_v_copy_stmt = values[0];
    __pyx_v_sink = values[1];
    __pyx_v_timeout = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_out", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 371, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_sink, __pyx_v_timeout);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":410
 *                         # Make asyncio shut up about unretrieved
 *                         # QueryCanceledError
 *                         waiter.add_done_callback(lambda f: f.exception())             # <<<<<<<<<<<<<<
 *                         raise
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6 = {"lambda6", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_f = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 410, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 410, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda6", 0) < (0)) __PYX_ERR(0, 410, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, i); __PYX_ERR(0, 410, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 410, __pyx_L3_error)
    }
    __pyx_v_f = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 410, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_f);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda6", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_f;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exception, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":371
 *             return await waiter
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_31copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_sink, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_out", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 371, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_copy_stmt = __pyx_v_copy_stmt;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_stmt);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_stmt);
  __pyx_cur_scope->__pyx_v_sink = __pyx_v_sink;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sink);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_copy_out, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_out, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  char const *__pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_out", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L27_resume_from_await;
    case 4: goto __pyx_L57_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 371, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":372
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":373
 *     async def copy_out(self, copy_stmt, sink, timeout):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 373, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 373, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":372
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":374
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":375
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 375, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 375, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":376
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":374
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":378
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 * 
 *         timeout = self._get_timeout_impl(timeout)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":380
 *         self._check_state()
 * 
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         timer = Timer(timeout)
 * 
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":381
 * 
 *         timeout = self._get_timeout_impl(timeout)
 *         timer = Timer(timeout)             # <<<<<<<<<<<<<<
 * 
 *         # The copy operation is guarded by a single timeout
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_timer = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":385
 *         # The copy operation is guarded by a single timeout
 *         # on the top level.
 *         waiter = self._new_waiter(timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 * 
 *         self._copy_out(copy_stmt)
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_timer;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/protocol.pyx":387
 *         waiter = self._new_waiter(timer.get_remaining_budget())
 * 
 *         self._copy_out(copy_stmt)             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_copy_stmt;
  __Pyx_INCREF(__pyx_t_5);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 387, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_out(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":389
 *         self._copy_out(copy_stmt)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 self.resume_reading()
*/
  /*try:*/ {

    /* "asyncpg/protocol/protocol.pyx":390
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 self.resume_reading()
 * 
*/
    while (1) {

      /* "asyncpg/protocol/protocol.pyx":391
 *         try:
 *             while True:
 *                 self.resume_reading()             # <<<<<<<<<<<<<<
 * 
 *                 with timer:
*/
      __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/protocol.pyx":393
 *                 self.resume_reading()
 * 
 *                 with timer:             # <<<<<<<<<<<<<<
 *                     buffer, done, status_msg = await waiter
 * 
*/
      /*with:*/ {
        __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_5 = NULL;
        __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        /*try:*/ {
          {
            __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            /*try:*/ {

              /* "asyncpg/protocol/protocol.pyx":394
 * 
 *                 with timer:
 *                     buffer, done, status_msg = await waiter             # <<<<<<<<<<<<<<
 * 
 *                 # buffer will be empty if CopyDone was received apart from
*/
              __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
              if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                __Pyx_GOTREF(__pyx_r);
                __Pyx_XGIVEREF(__pyx_t_7);
                __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                __Pyx_XGIVEREF(__pyx_t_8);
                __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                __Pyx_XGIVEREF(__pyx_t_9);
                __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                __Pyx_XGIVEREF(__pyx_t_10);
                __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
                __Pyx_XGIVEREF(__pyx_r);
                __Pyx_RefNannyFinishContext();
                __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                /* return from generator, awaiting value */
                __pyx_generator->resume_label = 3;
                return __pyx_r;
                __pyx_L27_resume_from_await:;
                __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                __pyx_cur_scope->__pyx_t_0 = 0;
                __Pyx_XGOTREF(__pyx_t_7);
                __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                __pyx_cur_scope->__pyx_t_1 = 0;
                __Pyx_XGOTREF(__pyx_t_8);
                __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                __pyx_cur_scope->__pyx_t_2 = 0;
                __Pyx_XGOTREF(__pyx_t_9);
                __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
                __pyx_cur_scope->__pyx_t_3 = 0;
                __Pyx_XGOTREF(__pyx_t_10);
                if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 394, __pyx_L19_error)
                __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
              } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                __Pyx_GOTREF(__pyx_r);
                __pyx_t_3 = __pyx_r; __pyx_r = NULL;
              } else {
                __Pyx_XGOTREF(__pyx_r);
                __PYX_ERR(0, 394, __pyx_L19_error)
              }
              if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
                PyObject* sequence = __pyx_t_3;
                Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
                if (unlikely(size != 3)) {
                  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  __PYX_ERR(0, 394, __pyx_L19_error)
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
                  __Pyx_INCREF(__pyx_t_4);
                  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
                  __Pyx_INCREF(__pyx_t_5);
                  __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
                  __Pyx_INCREF(__pyx_t_11);
                } else {
                  __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L19_error)
                  __Pyx_XGOTREF(__pyx_t_4);
                  __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L19_error)
                  __Pyx_XGOTREF(__pyx_t_5);
                  __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
                  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 394, __pyx_L19_error)
                  __Pyx_XGOTREF(__pyx_t_11);
                }
                #else
                __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_4);
                __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_5);
                __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 394, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_11);
                #endif
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 394, __pyx_L19_error)
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
                index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L28_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_4);
                index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L28_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_5);
                index = 2; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L28_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_11);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 3) < (0)) __PYX_ERR(0, 394, __pyx_L19_error)
                __pyx_t_13 = NULL;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                goto __pyx_L29_unpacking_done;
                __pyx_L28_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __pyx_t_13 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                __PYX_ERR(0, 394, __pyx_L19_error)
                __pyx_L29_unpacking_done:;
              }
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_buffer);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_buffer, __pyx_t_4);
              __Pyx_GIVEREF(__pyx_t_4);
              __pyx_t_4 = 0;
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_done);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_done, __pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_5);
              __pyx_t_5 = 0;
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_status_msg);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_status_msg, __pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_11);
              __pyx_t_11 = 0;

              /* "asyncpg/protocol/protocol.pyx":393
 *                 self.resume_reading()
 * 
 *                 with timer:             # <<<<<<<<<<<<<<
 *                     buffer, done, status_msg = await waiter
 * 
*/
            }
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L26_try_end;
            __pyx_L19_error:;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_11, &__pyx_t_5) < 0) __PYX_ERR(0, 393, __pyx_L21_except_error)
              __Pyx_XGOTREF(__pyx_t_3);
              __Pyx_XGOTREF(__pyx_t_11);
              __Pyx_XGOTREF(__pyx_t_5);
              __pyx_t_4 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L21_except_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 393, __pyx_L21_except_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (__pyx_t_1 < (0)) __PYX_ERR(0, 393, __pyx_L21_except_error)
              __pyx_t_15 = (!__pyx_t_1);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_5);
                __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_11, __pyx_t_5);
                __pyx_t_3 = 0;  __pyx_t_11 = 0;  __pyx_t_5 = 0; 
                __PYX_ERR(0, 393, __pyx_L21_except_error)
              }
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              goto __pyx_L20_exception_handled;
            }
            __pyx_L21_except_error:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            goto __pyx_L9_error;
            __pyx_L20_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            __pyx_L26_try_end:;
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_7) {
              __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[0], NULL);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
              if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 393, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            }
            goto __pyx_L18;
          }
          __pyx_L18:;
        }
        goto __pyx_L33;
        __pyx_L13_error:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L9_error;
        __pyx_L33:;
      }

      /* "asyncpg/protocol/protocol.pyx":398
 *                 # buffer will be empty if CopyDone was received apart from
 *                 # the last CopyData message.
 *                 if buffer:             # <<<<<<<<<<<<<<
 *                     try:
 *                         with timer:
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 398, __pyx_L9_error) }
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_buffer); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 398, __pyx_L9_error)
      if (__pyx_t_15) {

        /* "asyncpg/protocol/protocol.pyx":399
 *                 # the last CopyData message.
 *                 if buffer:
 *                     try:             # <<<<<<<<<<<<<<
 *                         with timer:
 *                             await compat.wait_for(
*/
        {
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_10, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {

            /* "asyncpg/protocol/protocol.pyx":400
 *                 if buffer:
 *                     try:
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             await compat.wait_for(
 *                                 sink(buffer),
*/
            /*with:*/ {
              __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 400, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_8);
              __pyx_t_11 = NULL;
              __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L43_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_6 = 1;
              #if CYTHON_UNPACK_METHODS
              if (likely(PyMethod_Check(__pyx_t_3))) {
                __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
                assert(__pyx_t_11);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_11);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
                __pyx_t_6 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
                __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L43_error)
                __Pyx_GOTREF(__pyx_t_5);
              }
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              /*try:*/ {
                {
                  __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_16, &__pyx_t_17);
                  __Pyx_XGOTREF(__pyx_t_14);
                  __Pyx_XGOTREF(__pyx_t_16);
                  __Pyx_XGOTREF(__pyx_t_17);
                  /*try:*/ {

                    /* "asyncpg/protocol/protocol.pyx":401
 *                     try:
 *                         with timer:
 *                             await compat.wait_for(             # <<<<<<<<<<<<<<
 *                                 sink(buffer),
 *                                 timeout=timer.get_remaining_budget())
*/
                    __pyx_t_3 = NULL;
                    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 401, __pyx_L49_error)
                    __Pyx_GOTREF(__pyx_t_11);
                    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L49_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

                    /* "asyncpg/protocol/protocol.pyx":402
 *                         with timer:
 *                             await compat.wait_for(
 *                                 sink(buffer),             # <<<<<<<<<<<<<<
 *                                 timeout=timer.get_remaining_budget())
 *                     except (Exception, asyncio.CancelledError) as ex:
*/
                    __pyx_t_12 = NULL;
                    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sink);
                    __pyx_t_18 = __pyx_cur_scope->__pyx_v_sink; 
                    if (unlikely(!__pyx_cur_scope->__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); __PYX_ERR(0, 402, __pyx_L49_error) }
                    __pyx_t_6 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_18))) {
                      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_18);
                      assert(__pyx_t_12);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
                      __Pyx_INCREF(__pyx_t_12);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
                      __pyx_t_6 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_buffer};
                      __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                      if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 402, __pyx_L49_error)
                      __Pyx_GOTREF(__pyx_t_11);
                    }

                    /* "asyncpg/protocol/protocol.pyx":403
 *                             await compat.wait_for(
 *                                 sink(buffer),
 *                                 timeout=timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 *                     except (Exception, asyncio.CancelledError) as ex:
 *                         # Abort the COPY operation on any error in
*/
                    __pyx_t_12 = __pyx_cur_scope->__pyx_v_timer;
                    __Pyx_INCREF(__pyx_t_12);
                    __pyx_t_6 = 0;
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
                      __pyx_t_18 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                      if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 403, __pyx_L49_error)
                      __Pyx_GOTREF(__pyx_t_18);
                    }
                    __pyx_t_6 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_4))) {
                      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
                      assert(__pyx_t_3);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
                      __Pyx_INCREF(__pyx_t_3);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
                      __pyx_t_6 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, __pyx_t_11};
                      __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 401, __pyx_L49_error)
                      __Pyx_GOTREF(__pyx_t_12);
                      if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_18, __pyx_t_12, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 401, __pyx_L49_error)
                      __pyx_t_5 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
                      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L49_error)
                      __Pyx_GOTREF(__pyx_t_5);
                    }
                    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r);
                    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                      __Pyx_GOTREF(__pyx_r);
                      __Pyx_XGIVEREF(__pyx_t_7);
                      __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                      __Pyx_XGIVEREF(__pyx_t_8);
                      __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                      __Pyx_XGIVEREF(__pyx_t_9);
                      __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                      __Pyx_XGIVEREF(__pyx_t_10);
                      __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
                      __Pyx_XGIVEREF(__pyx_t_14);
                      __pyx_cur_scope->__pyx_t_4 = __pyx_t_14;
                      __Pyx_XGIVEREF(__pyx_t_16);
                      __pyx_cur_scope->__pyx_t_5 = __pyx_t_16;
                      __Pyx_XGIVEREF(__pyx_t_17);
                      __pyx_cur_scope->__pyx_t_6 = __pyx_t_17;
                      __Pyx_XGIVEREF(__pyx_r);
                      __Pyx_RefNannyFinishContext();
                      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                      /* return from generator, awaiting value */
                      __pyx_generator->resume_label = 4;
                      return __pyx_r;
                      __pyx_L57_resume_from_await:;
                      __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                      __pyx_cur_scope->__pyx_t_0 = 0;
                      __Pyx_XGOTREF(__pyx_t_7);
                      __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                      __pyx_cur_scope->__pyx_t_1 = 0;
                      __Pyx_XGOTREF(__pyx_t_8);
                      __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                      __pyx_cur_scope->__pyx_t_2 = 0;
                      __Pyx_XGOTREF(__pyx_t_9);
                      __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
                      __pyx_cur_scope->__pyx_t_3 = 0;
                      __Pyx_XGOTREF(__pyx_t_10);
                      __pyx_t_14 = __pyx_cur_scope->__pyx_t_4;
                      __pyx_cur_scope->__pyx_t_4 = 0;
                      __Pyx_XGOTREF(__pyx_t_14);
                      __pyx_t_16 = __pyx_cur_scope->__pyx_t_5;
                      __pyx_cur_scope->__pyx_t_5 = 0;
                      __Pyx_XGOTREF(__pyx_t_16);
                      __pyx_t_17 = __pyx_cur_scope->__pyx_t_6;
                      __pyx_cur_scope->__pyx_t_6 = 0;
                      __Pyx_XGOTREF(__pyx_t_17);
                      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 401, __pyx_L49_error)
                    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                      __Pyx_GOTREF(__pyx_r);
                      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                    } else {
                      __Pyx_XGOTREF(__pyx_r);
                      __PYX_ERR(0, 401, __pyx_L49_error)
                    }

                    /* "asyncpg/protocol/protocol.pyx":400
 *                 if buffer:
 *                     try:
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             await compat.wait_for(
 *                                 sink(buffer),
*/
                  }
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                  goto __pyx_L56_try_end;
                  __pyx_L49_error:;
                  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  /*except:*/ {
                    __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
                    if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 400, __pyx_L51_except_error)
                    __Pyx_XGOTREF(__pyx_t_5);
                    __Pyx_XGOTREF(__pyx_t_4);
                    __Pyx_XGOTREF(__pyx_t_12);
                    __pyx_t_18 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_12); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 400, __pyx_L51_except_error)
                    __Pyx_GOTREF(__pyx_t_18);
                    __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_18, NULL);
                    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                    if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 400, __pyx_L51_except_error)
                    __Pyx_GOTREF(__pyx_t_19);
                    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_19);
                    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                    if (__pyx_t_15 < (0)) __PYX_ERR(0, 400, __pyx_L51_except_error)
                    __pyx_t_1 = (!__pyx_t_15);
                    if (unlikely(__pyx_t_1)) {
                      __Pyx_GIVEREF(__pyx_t_5);
                      __Pyx_GIVEREF(__pyx_t_4);
                      __Pyx_XGIVEREF(__pyx_t_12);
                      __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12);
                      __pyx_t_5 = 0;  __pyx_t_4 = 0;  __pyx_t_12 = 0; 
                      __PYX_ERR(0, 400, __pyx_L51_except_error)
                    }
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                    goto __pyx_L50_exception_handled;
                  }
                  __pyx_L51_except_error:;
                  __Pyx_XGIVEREF(__pyx_t_14);
                  __Pyx_XGIVEREF(__pyx_t_16);
                  __Pyx_XGIVEREF(__pyx_t_17);
                  __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_16, __pyx_t_17);
                  goto __pyx_L35_error;
                  __pyx_L50_exception_handled:;
                  __Pyx_XGIVEREF(__pyx_t_14);
                  __Pyx_XGIVEREF(__pyx_t_16);
                  __Pyx_XGIVEREF(__pyx_t_17);
                  __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_16, __pyx_t_17);
                  __pyx_L56_try_end:;
                }
              }
              /*finally:*/ {
                /*normal exit:*/{
                  if (__pyx_t_8) {
                    __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL);
                    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                    if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 400, __pyx_L35_error)
                    __Pyx_GOTREF(__pyx_t_17);
                    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  }
                  goto __pyx_L48;
                }
                __pyx_L48:;
              }
              goto __pyx_L61;
              __pyx_L43_error:;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L35_error;
              __pyx_L61:;
            }

            /* "asyncpg/protocol/protocol.pyx":399
 *                 # the last CopyData message.
 *                 if buffer:
 *                     try:             # <<<<<<<<<<<<<<
 *                         with timer:
 *                             await compat.wait_for(
*/
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L42_try_end;
          __pyx_L35_error:;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/protocol.pyx":404
 *                                 sink(buffer),
 *                                 timeout=timer.get_remaining_budget())
 *                     except (Exception, asyncio.CancelledError) as ex:             # <<<<<<<<<<<<<<
 *                         # Abort the COPY operation on any error in
 *                         # output sink.
*/
          __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_4, &__pyx_t_5);
          __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 404, __pyx_L37_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_CancelledError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 404, __pyx_L37_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __pyx_t_20 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_12, ((PyObject *)(((PyTypeObject*)PyExc_Exception))), __pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_4, __pyx_t_5);
          __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
          if (__pyx_t_20) {
            __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 404, __pyx_L37_except_error)
            __Pyx_XGOTREF(__pyx_t_5);
            __Pyx_XGOTREF(__pyx_t_4);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_4);
            __pyx_cur_scope->__pyx_v_ex = __pyx_t_4;
            /*try:*/ {

              /* "asyncpg/protocol/protocol.pyx":407
 *                         # Abort the COPY operation on any error in
 *                         # output sink.
 *                         self._request_cancel()             # <<<<<<<<<<<<<<
 *                         # Make asyncio shut up about unretrieved
 *                         # QueryCanceledError
*/
              __pyx_t_18 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
              __Pyx_INCREF(__pyx_t_18);
              __pyx_t_6 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL};
                __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 407, __pyx_L67_error)
                __Pyx_GOTREF(__pyx_t_11);
              }
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

              /* "asyncpg/protocol/protocol.pyx":410
 *                         # Make asyncio shut up about unretrieved
 *                         # QueryCanceledError
 *                         waiter.add_done_callback(lambda f: f.exception())             # <<<<<<<<<<<<<<
 *                         raise
 * 
*/
              __pyx_t_18 = __pyx_cur_scope->__pyx_v_waiter;
              __Pyx_INCREF(__pyx_t_18);
              __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_8copy_out_lambda6, 0, __pyx_mstate_global->__pyx_n_u_copy_out_locals_lambda, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L67_error)
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_6 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_3};
                __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 410, __pyx_L67_error)
                __Pyx_GOTREF(__pyx_t_11);
              }
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

              /* "asyncpg/protocol/protocol.pyx":411
 *                         # QueryCanceledError
 *                         waiter.add_done_callback(lambda f: f.exception())
 *                         raise             # <<<<<<<<<<<<<<
 * 
 *                 # done will be True upon receipt of CopyDone.
*/
              __Pyx_GIVEREF(__pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_XGIVEREF(__pyx_t_12);
              __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12);
              __pyx_t_5 = 0;  __pyx_t_4 = 0;  __pyx_t_12 = 0; 
              __PYX_ERR(0, 411, __pyx_L67_error)
            }

            /* "asyncpg/protocol/protocol.pyx":404
 *                                 sink(buffer),
 *                                 timeout=timer.get_remaining_budget())
 *                     except (Exception, asyncio.CancelledError) as ex:             # <<<<<<<<<<<<<<
 *                         # Abort the COPY operation on any error in
 *                         # output sink.
*/
            /*finally:*/ {
              __pyx_L67_error:;
              /*exception exit:*/{
                __Pyx_PyThreadState_assign
                __pyx_t_8 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_19 = 0; __pyx_t_23 = 0;
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                 __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_19, &__pyx_t_23);
                if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_17, &__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_8);
                __Pyx_XGOTREF(__pyx_t_17);
                __Pyx_XGOTREF(__pyx_t_16);
                __Pyx_XGOTREF(__pyx_t_14);
                __Pyx_XGOTREF(__pyx_t_19);
                __Pyx_XGOTREF(__pyx_t_23);
                __pyx_t_20 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
                {
                  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                }
                __Pyx_XGIVEREF(__pyx_t_14);
                __Pyx_XGIVEREF(__pyx_t_19);
                __Pyx_XGIVEREF(__pyx_t_23);
                __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_19, __pyx_t_23);
                __Pyx_XGIVEREF(__pyx_t_8);
                __Pyx_XGIVEREF(__pyx_t_17);
                __Pyx_XGIVEREF(__pyx_t_16);
                __Pyx_ErrRestore(__pyx_t_8, __pyx_t_17, __pyx_t_16);
                __pyx_t_8 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_14 = 0; __pyx_t_19 = 0; __pyx_t_23 = 0;
                __pyx_lineno = __pyx_t_20; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
                goto __pyx_L37_except_error;
              }
            }
          }
          goto __pyx_L37_except_error;

          /* "asyncpg/protocol/protocol.pyx":399
 *                 # the last CopyData message.
 *                 if buffer:
 *                     try:             # <<<<<<<<<<<<<<
 *                         with timer:
 *                             await compat.wait_for(
*/
          __pyx_L37_except_error:;
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_10, __pyx_t_9);
          goto __pyx_L9_error;
          __pyx_L42_try_end:;
        }

        /* "asyncpg/protocol/protocol.pyx":398
 *                 # buffer will be empty if CopyDone was received apart from
 *                 # the last CopyData message.
 *                 if buffer:             # <<<<<<<<<<<<<<
 *                     try:
 *                         with timer:
*/
      }

      /* "asyncpg/protocol/protocol.pyx":414
 * 
 *                 # done will be True upon receipt of CopyDone.
 *                 if done:             # <<<<<<<<<<<<<<
 *                     break
 * 
*/
      if (unlikely(!__pyx_cur_scope->__pyx_v_done)) { __Pyx_RaiseUnboundLocalError("done"); __PYX_ERR(0, 414, __pyx_L9_error) }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_done); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 414, __pyx_L9_error)
      if (__pyx_t_1) {

        /* "asyncpg/protocol/protocol.pyx":415
 *                 # done will be True upon receipt of CopyDone.
 *                 if done:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 waiter = self._new_waiter(timer.get_remaining_budget())
*/
        goto __pyx_L12_break;

        /* "asyncpg/protocol/protocol.pyx":414
 * 
 *                 # done will be True upon receipt of CopyDone.
 *                 if done:             # <<<<<<<<<<<<<<
 *                     break
 * 
*/
      }

      /* "asyncpg/protocol/protocol.pyx":417
 *                     break
 * 
 *                 waiter = self._new_waiter(timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 * 
 *         finally:
*/
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_timer;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 417, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_12);
      }
      __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_waiter);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_waiter, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L12_break:;
  }

  /* "asyncpg/protocol/protocol.pyx":420
 * 
 *         finally:
 *             self.resume_reading()             # <<<<<<<<<<<<<<
 * 
 *         return status_msg
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L10;
    }
    __pyx_L9_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_19, &__pyx_t_14);
      if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_23);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_21 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
      {
        __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L75_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_23);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_19, __pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_7);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_21; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_24;
      goto __pyx_L1_error;
      __pyx_L75_error:;
      __Pyx_XGIVEREF(__pyx_t_23);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_19, __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_23 = 0; __pyx_t_19 = 0; __pyx_t_14 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L10:;
  }

  /* "asyncpg/protocol/protocol.pyx":422
 *             self.resume_reading()
 * 
 *         return status_msg             # <<<<<<<<<<<<<<
 * 
 *     async def copy_in(self, copy_stmt, reader, data,
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_status_msg)) { __Pyx_RaiseUnboundLocalError("status_msg"); __PYX_ERR(0, 422, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_status_msg);
  __pyx_r = __pyx_cur_scope->__pyx_v_status_msg;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":371
 *             return await waiter
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_18);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":424
 *         return status_msg
 * 
 *     async def copy_in(self, copy_stmt, reader, data,             # <<<<<<<<<<<<<<
 *                       records, PreparedStatementState record_stmt, timeout):
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in = {"copy_in", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_copy_stmt = 0;
  PyObject *__pyx_v_reader = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_records = 0;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_in (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_copy_stmt,&__pyx_mstate_global->__pyx_n_u_reader,&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_records,&__pyx_mstate_global->__pyx_n_u_record_stmt,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 424, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy_in", 0) < (0)) __PYX_ERR(0, 424, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, i); __PYX_ERR(0, 424, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 424, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 424, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 424, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 424, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 424, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 424, __pyx_L3_error)
    }
    __pyx_v_copy_stmt = values[0];
    __pyx_v_reader = values[1];
    __pyx_v_data = values[2];
    __pyx_v_records = values[3];
    __pyx_v_record_stmt = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[4]);
    __pyx_v_timeout = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_in", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 424, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_record_stmt), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "record_stmt", 0))) __PYX_ERR(0, 425, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_copy_stmt, __pyx_v_reader, __pyx_v_data, __pyx_v_records, __pyx_v_record_stmt, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":553
 *             self._request_cancel()
 *             # Make asyncio shut up about unretrieved QueryCanceledError
 *             waiter.add_done_callback(lambda f: f.exception())             # <<<<<<<<<<<<<<
 *             raise
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7 = {"lambda7", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_f = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 553, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 553, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda7", 0) < (0)) __PYX_ERR(0, 553, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, i); __PYX_ERR(0, 553, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 553, __pyx_L3_error)
    }
    __pyx_v_f = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 553, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_f);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda7", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_v_f;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exception, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":424
 *         return status_msg
 * 
 *     async def copy_in(self, copy_stmt, reader, data,             # <<<<<<<<<<<<<<
 *                       records, PreparedStatementState record_stmt, timeout):
 *         cdef:
*/

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_34copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_copy_stmt, PyObject *__pyx_v_reader, PyObject *__pyx_v_data, PyObject *__pyx_v_records, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_record_stmt, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_in", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 424, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_copy_stmt = __pyx_v_copy_stmt;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_stmt);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_stmt);
  __pyx_cur_scope->__pyx_v_reader = __pyx_v_reader;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reader);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reader);
  __pyx_cur_scope->__pyx_v_data = __pyx_v_data;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data);
  __pyx_cur_scope->__pyx_v_records = __pyx_v_records;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_records);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_records);
  __pyx_cur_scope->__pyx_v_record_stmt = __pyx_v_record_stmt;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_copy_in, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_in, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 424, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  PyObject *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *(*__pyx_t_26)(PyObject *);
  int __pyx_t_27;
  PyObject *__pyx_t_28 = NULL;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  int __pyx_t_31;
  char const *__pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_in", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L24_resume_from_await;
    case 4: goto __pyx_L43_resume_from_await;
    case 5: goto __pyx_L69_resume_from_await;
    case 6: goto __pyx_L105_resume_from_await;
    case 7: goto __pyx_L124_resume_from_await;
    case 8: goto __pyx_L131_resume_from_await;
    case 9: goto __pyx_L142_resume_from_await;
    case 10: goto __pyx_L156_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 424, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":431
 *             Codec codec
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":432
 * 
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 432, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 432, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":431
 *             Codec codec
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":433
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":434
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 434, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 434, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":435
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":433
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":437
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 * 
 *         timeout = self._get_timeout_impl(timeout)
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":439
 *         self._check_state()
 * 
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         timer = Timer(timeout)
 * 
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":440
 * 
 *         timeout = self._get_timeout_impl(timeout)
 *         timer = Timer(timeout)             # <<<<<<<<<<<<<<
 * 
 *         waiter = self._new_waiter(timer.get_remaining_budget())
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Timer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_timeout};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_timer = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":442
 *         timer = Timer(timeout)
 * 
 *         waiter = self._new_waiter(timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 * 
 *         # Initiate COPY IN.
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_timer;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "asyncpg/protocol/protocol.pyx":445
 * 
 *         # Initiate COPY IN.
 *         self._copy_in(copy_stmt)             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_copy_stmt;
  __Pyx_INCREF(__pyx_t_5);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 445, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._copy_in(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":447
 *         self._copy_in(copy_stmt)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if record_stmt is not None:
 *                 # copy_in_records in binary mode
*/
  {
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "asyncpg/protocol/protocol.pyx":448
 * 
 *         try:
 *             if record_stmt is not None:             # <<<<<<<<<<<<<<
 *                 # copy_in_records in binary mode
 *                 wbuf = WriteBuffer.new()
*/
      __pyx_t_1 = (((PyObject *)__pyx_cur_scope->__pyx_v_record_stmt) != Py_None);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/protocol.pyx":450
 *             if record_stmt is not None:
 *                 # copy_in_records in binary mode
 *                 wbuf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *                 # Signature
 *                 wbuf.write_bytes(_COPY_SIGNATURE)
*/
        __pyx_t_3 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_wbuf = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":452
 *                 wbuf = WriteBuffer.new()
 *                 # Signature
 *                 wbuf.write_bytes(_COPY_SIGNATURE)             # <<<<<<<<<<<<<<
 *                 # Flags field
 *                 wbuf.write_int32(0)
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_wbuf, __pyx_mstate_global->__pyx_kp_b_PGCOPY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":454
 *                 wbuf.write_bytes(_COPY_SIGNATURE)
 *                 # Flags field
 *                 wbuf.write_int32(0)             # <<<<<<<<<<<<<<
 *                 # No header extension
 *                 wbuf.write_int32(0)
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":456
 *                 wbuf.write_int32(0)
 *                 # No header extension
 *                 wbuf.write_int32(0)             # <<<<<<<<<<<<<<
 * 
 *                 record_stmt._ensure_rows_decoder()
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":458
 *                 wbuf.write_int32(0)
 * 
 *                 record_stmt._ensure_rows_decoder()             # <<<<<<<<<<<<<<
 *                 codecs = record_stmt.rows_codecs
 *                 num_cols = len(codecs)
*/
        __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder(__pyx_cur_scope->__pyx_v_record_stmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":459
 * 
 *                 record_stmt._ensure_rows_decoder()
 *                 codecs = record_stmt.rows_codecs             # <<<<<<<<<<<<<<
 *                 num_cols = len(codecs)
 *                 settings = self.settings
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_record_stmt->rows_codecs;
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_codecs = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":460
 *                 record_stmt._ensure_rows_decoder()
 *                 codecs = record_stmt.rows_codecs
 *                 num_cols = len(codecs)             # <<<<<<<<<<<<<<
 *                 settings = self.settings
 * 
*/
        if (unlikely(__pyx_cur_scope->__pyx_v_codecs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 460, __pyx_L8_error)
        }
        __pyx_t_10 = __Pyx_PyTuple_GET_SIZE(__pyx_cur_scope->__pyx_v_codecs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 460, __pyx_L8_error)
        __pyx_cur_scope->__pyx_v_num_cols = __pyx_t_10;

        /* "asyncpg/protocol/protocol.pyx":461
 *                 codecs = record_stmt.rows_codecs
 *                 num_cols = len(codecs)
 *                 settings = self.settings             # <<<<<<<<<<<<<<
 * 
 *                 for codec in codecs:
*/
        __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->settings);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":463
 *                 settings = self.settings
 * 
 *                 for codec in codecs:             # <<<<<<<<<<<<<<
 *                     if (not codec.has_encoder() or
 *                             codec.format != PG_FORMAT_BINARY):
*/
        if (unlikely(__pyx_cur_scope->__pyx_v_codecs == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(0, 463, __pyx_L8_error)
        }
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_codecs; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_10 = 0;
        for (;;) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L8_error)
            #endif
            if (__pyx_t_10 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10);
          #endif
          ++__pyx_t_10;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec))))) __PYX_ERR(0, 463, __pyx_L8_error)
          __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5));
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_5 = 0;

          /* "asyncpg/protocol/protocol.pyx":464
 * 
 *                 for codec in codecs:
 *                     if (not codec.has_encoder() or             # <<<<<<<<<<<<<<
 *                             codec.format != PG_FORMAT_BINARY):
 *                         raise apg_exc.InternalClientError(
*/
          __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder(__pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 464, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_12 = (!__pyx_t_11);
          if (!__pyx_t_12) {
          } else {
            __pyx_t_1 = __pyx_t_12;
            goto __pyx_L18_bool_binop_done;
          }

          /* "asyncpg/protocol/protocol.pyx":465
 *                 for codec in codecs:
 *                     if (not codec.has_encoder() or
 *                             codec.format != PG_FORMAT_BINARY):             # <<<<<<<<<<<<<<
 *                         raise apg_exc.InternalClientError(
 *                             'no binary format encoder for '
*/
          __pyx_t_12 = (__pyx_cur_scope->__pyx_v_codec->format != __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_BINARY);
          __pyx_t_1 = __pyx_t_12;
          __pyx_L18_bool_binop_done:;

          /* "asyncpg/protocol/protocol.pyx":464
 * 
 *                 for codec in codecs:
 *                     if (not codec.has_encoder() or             # <<<<<<<<<<<<<<
 *                             codec.format != PG_FORMAT_BINARY):
 *                         raise apg_exc.InternalClientError(
*/
          if (unlikely(__pyx_t_1)) {

            /* "asyncpg/protocol/protocol.pyx":466
 *                     if (not codec.has_encoder() or
 *                             codec.format != PG_FORMAT_BINARY):
 *                         raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                             'no binary format encoder for '
 *                             'type {} (OID {})'.format(codec.name, codec.oid))
*/
            __pyx_t_4 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 466, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 466, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "asyncpg/protocol/protocol.pyx":468
 *                         raise apg_exc.InternalClientError(
 *                             'no binary format encoder for '
 *                             'type {} (OID {})'.format(codec.name, codec.oid))             # <<<<<<<<<<<<<<
 * 
 *                 if isinstance(records, collections.abc.AsyncIterable):
*/
            __pyx_t_15 = __pyx_mstate_global->__pyx_kp_u_no_binary_format_encoder_for_typ;
            __Pyx_INCREF(__pyx_t_15);
            __pyx_t_16 = __Pyx_PyLong_From_uint32_t(__pyx_cur_scope->__pyx_v_codec->oid); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 468, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_6 = 0;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_15, __pyx_cur_scope->__pyx_v_codec->name, __pyx_t_16};
              __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 468, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_13);
            }
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_14))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
              assert(__pyx_t_4);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_Raise(__pyx_t_5, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __PYX_ERR(0, 466, __pyx_L8_error)

            /* "asyncpg/protocol/protocol.pyx":464
 * 
 *                 for codec in codecs:
 *                     if (not codec.has_encoder() or             # <<<<<<<<<<<<<<
 *                             codec.format != PG_FORMAT_BINARY):
 *                         raise apg_exc.InternalClientError(
*/
          }

          /* "asyncpg/protocol/protocol.pyx":463
 *                 settings = self.settings
 * 
 *                 for codec in codecs:             # <<<<<<<<<<<<<<
 *                     if (not codec.has_encoder() or
 *                             codec.format != PG_FORMAT_BINARY):
*/
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":470
 *                             'type {} (OID {})'.format(codec.name, codec.oid))
 * 
 *                 if isinstance(records, collections.abc.AsyncIterable):             # <<<<<<<<<<<<<<
 *                     async for row in records:
 *                         # Tuple header
*/
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AsyncIterable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_records, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 470, __pyx_L8_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_1) {

          /* "asyncpg/protocol/protocol.pyx":471
 * 
 *                 if isinstance(records, collections.abc.AsyncIterable):
 *                     async for row in records:             # <<<<<<<<<<<<<<
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)
*/
          __pyx_t_3 = __Pyx_Coroutine_GetAsyncIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          for (;;) {
            __pyx_t_5 = __Pyx_Coroutine_AsyncIterNext(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (likely(__pyx_t_2 == PYGEN_NEXT)) {
              __Pyx_GOTREF(__pyx_r);
              __Pyx_XGIVEREF(__pyx_t_3);
              __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
              __Pyx_XGIVEREF(__pyx_t_7);
              __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
              __Pyx_XGIVEREF(__pyx_t_8);
              __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
              __Pyx_XGIVEREF(__pyx_t_9);
              __pyx_cur_scope->__pyx_t_3 = __pyx_t_9;
              __Pyx_XGIVEREF(__pyx_r);
              __Pyx_RefNannyFinishContext();
              __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
              /* return from generator, awaiting value */
              __pyx_generator->resume_label = 3;
              return __pyx_r;
              __pyx_L24_resume_from_await:;
              __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
              __pyx_cur_scope->__pyx_t_0 = 0;
              __Pyx_XGOTREF(__pyx_t_3);
              __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
              __pyx_cur_scope->__pyx_t_1 = 0;
              __Pyx_XGOTREF(__pyx_t_7);
              __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
              __pyx_cur_scope->__pyx_t_2 = 0;
              __Pyx_XGOTREF(__pyx_t_8);
              __pyx_t_9 = __pyx_cur_scope->__pyx_t_3;
              __pyx_cur_scope->__pyx_t_3 = 0;
              __Pyx_XGOTREF(__pyx_t_9);
              if (unlikely(!__pyx_sent_value)) {
                PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
                if (unlikely(exc_type && (exc_type == PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopAsyncIteration))))) {
                  PyErr_Clear();
                  break;
                }
                __PYX_ERR(0, 471, __pyx_L8_error)
              }
              __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5);
            } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
              __Pyx_GOTREF(__pyx_r);
              __pyx_t_5 = __pyx_r; __pyx_r = NULL;
            } else {
              PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
              if (unlikely(exc_type && (exc_type == PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopAsyncIteration))))) {
                PyErr_Clear();
                break;
              }
              __Pyx_XGOTREF(__pyx_r);
              __PYX_ERR(0, 471, __pyx_L8_error)
            }
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_5);
            __pyx_t_5 = 0;

            /* "asyncpg/protocol/protocol.pyx":473
 *                     async for row in records:
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)             # <<<<<<<<<<<<<<
 *                         # Tuple data
 *                         for i in range(num_cols):
*/
            __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, ((int16_t)__pyx_cur_scope->__pyx_v_num_cols)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "asyncpg/protocol/protocol.pyx":475
 *                         wbuf.write_int16(<int16_t>num_cols)
 *                         # Tuple data
 *                         for i in range(num_cols):             # <<<<<<<<<<<<<<
 *                             item = row[i]
 *                             if item is None:
*/
            __pyx_t_17 = __pyx_cur_scope->__pyx_v_num_cols;
            __pyx_t_18 = __pyx_t_17;
            for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
              __pyx_cur_scope->__pyx_v_i = __pyx_t_19;

              /* "asyncpg/protocol/protocol.pyx":476
 *                         # Tuple data
 *                         for i in range(num_cols):
 *                             item = row[i]             # <<<<<<<<<<<<<<
 *                             if item is None:
 *                                 wbuf.write_int32(-1)
*/
              __pyx_t_5 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_5);
              __Pyx_GIVEREF(__pyx_t_5);
              __pyx_t_5 = 0;

              /* "asyncpg/protocol/protocol.pyx":477
 *                         for i in range(num_cols):
 *                             item = row[i]
 *                             if item is None:             # <<<<<<<<<<<<<<
 *                                 wbuf.write_int32(-1)
 *                             else:
*/
              __pyx_t_1 = (__pyx_cur_scope->__pyx_v_item == Py_None);
              if (__pyx_t_1) {

                /* "asyncpg/protocol/protocol.pyx":478
 *                             item = row[i]
 *                             if item is None:
 *                                 wbuf.write_int32(-1)             # <<<<<<<<<<<<<<
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
*/
                __pyx_t_5 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

                /* "asyncpg/protocol/protocol.pyx":477
 *                         for i in range(num_cols):
 *                             item = row[i]
 *                             if item is None:             # <<<<<<<<<<<<<<
 *                                 wbuf.write_int32(-1)
 *                             else:
*/
                goto __pyx_L27;
              }

              /* "asyncpg/protocol/protocol.pyx":480
 *                                 wbuf.write_int32(-1)
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(             # <<<<<<<<<<<<<<
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)
*/
              /*else*/ {

                /* "asyncpg/protocol/protocol.pyx":481
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
 *                                     codecs, i)             # <<<<<<<<<<<<<<
 *                                 codec.encode(settings, wbuf, item)
 * 
*/
                __pyx_t_20 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i);

                /* "asyncpg/protocol/protocol.pyx":480
 *                                 wbuf.write_int32(-1)
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(             # <<<<<<<<<<<<<<
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)
*/
                __pyx_t_5 = ((PyObject *)__pyx_t_20);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_5));
                __Pyx_GIVEREF(__pyx_t_5);
                __pyx_t_5 = 0;

                /* "asyncpg/protocol/protocol.pyx":482
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)             # <<<<<<<<<<<<<<
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
*/
                __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_settings, __pyx_cur_scope->__pyx_v_wbuf, __pyx_cur_scope->__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_5);
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              }
              __pyx_L27:;
            }

            /* "asyncpg/protocol/protocol.pyx":484
 *                                 codec.encode(settings, wbuf, item)
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:             # <<<<<<<<<<<<<<
 *                             with timer:
 *                                 await self.writing_allowed.wait()
*/
            __pyx_t_5 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_14 = PyObject_RichCompare(__pyx_t_5, __pyx_mstate_global->__pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 484, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 484, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_1) {

              /* "asyncpg/protocol/protocol.pyx":485
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:             # <<<<<<<<<<<<<<
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
*/
              /*with:*/ {
                __pyx_t_21 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 485, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_21);
                __pyx_t_5 = NULL;
                __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 485, __pyx_L29_error)
                __Pyx_GOTREF(__pyx_t_13);
                __pyx_t_6 = 1;
                #if CYTHON_UNPACK_METHODS
                if (likely(PyMethod_Check(__pyx_t_13))) {
                  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13);
                  assert(__pyx_t_5);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
                  __Pyx_INCREF(__pyx_t_5);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
                  __pyx_t_6 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
                  __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 485, __pyx_L29_error)
                  __Pyx_GOTREF(__pyx_t_14);
                }
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                /*try:*/ {
                  {
                    __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
                    __Pyx_XGOTREF(__pyx_t_22);
                    __Pyx_XGOTREF(__pyx_t_23);
                    __Pyx_XGOTREF(__pyx_t_24);
                    /*try:*/ {

                      /* "asyncpg/protocol/protocol.pyx":486
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:
 *                                 await self.writing_allowed.wait()             # <<<<<<<<<<<<<<
 *                             self._write_copy_data_msg(wbuf)
 *                             wbuf = WriteBuffer.new()
*/
                      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L35_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_13 = __pyx_t_5;
                      __Pyx_INCREF(__pyx_t_13);
                      __pyx_t_6 = 0;
                      {
                        PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
                        __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 486, __pyx_L35_error)
                        __Pyx_GOTREF(__pyx_t_14);
                      }
                      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14, &__pyx_r);
                      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_XGIVEREF(__pyx_t_3);
                        __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
                        __Pyx_XGIVEREF(__pyx_t_7);
                        __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
                        __Pyx_XGIVEREF(__pyx_t_8);
                        __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
                        __Pyx_XGIVEREF(__pyx_t_9);
                        __pyx_cur_scope->__pyx_t_3 = __pyx_t_9;
                        __Pyx_XGIVEREF(__pyx_t_21);
                        __pyx_cur_scope->__pyx_t_4 = __pyx_t_21;
                        __Pyx_XGIVEREF(__pyx_t_22);
                        __pyx_cur_scope->__pyx_t_5 = __pyx_t_22;
                        __Pyx_XGIVEREF(__pyx_t_23);
                        __pyx_cur_scope->__pyx_t_6 = __pyx_t_23;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __pyx_cur_scope->__pyx_t_7 = __pyx_t_24;
                        __Pyx_XGIVEREF(__pyx_r);
                        __Pyx_RefNannyFinishContext();
                        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                        /* return from generator, awaiting value */
                        __pyx_generator->resume_label = 4;
                        return __pyx_r;
                        __pyx_L43_resume_from_await:;
                        __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
                        __pyx_cur_scope->__pyx_t_0 = 0;
                        __Pyx_XGOTREF(__pyx_t_3);
                        __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
                        __pyx_cur_scope->__pyx_t_1 = 0;
                        __Pyx_XGOTREF(__pyx_t_7);
                        __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
                        __pyx_cur_scope->__pyx_t_2 = 0;
                        __Pyx_XGOTREF(__pyx_t_8);
                        __pyx_t_9 = __pyx_cur_scope->__pyx_t_3;
                        __pyx_cur_scope->__pyx_t_3 = 0;
                        __Pyx_XGOTREF(__pyx_t_9);
                        __pyx_t_21 = __pyx_cur_scope->__pyx_t_4;
                        __pyx_cur_scope->__pyx_t_4 = 0;
                        __Pyx_XGOTREF(__pyx_t_21);
                        __pyx_t_22 = __pyx_cur_scope->__pyx_t_5;
                        __pyx_cur_scope->__pyx_t_5 = 0;
                        __Pyx_XGOTREF(__pyx_t_22);
                        __pyx_t_23 = __pyx_cur_scope->__pyx_t_6;
                        __pyx_cur_scope->__pyx_t_6 = 0;
                        __Pyx_XGOTREF(__pyx_t_23);
                        __pyx_t_24 = __pyx_cur_scope->__pyx_t_7;
                        __pyx_cur_scope->__pyx_t_7 = 0;
                        __Pyx_XGOTREF(__pyx_t_24);
                        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 486, __pyx_L35_error)
                      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                      } else {
                        __Pyx_XGOTREF(__pyx_r);
                        __PYX_ERR(0, 486, __pyx_L35_error)
                      }

                      /* "asyncpg/protocol/protocol.pyx":485
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:             # <<<<<<<<<<<<<<
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
*/
                    }
                    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                    __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                    goto __pyx_L42_try_end;
                    __pyx_L35_error:;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    /*except:*/ {
                      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
                      if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_5, &__pyx_t_13) < 0) __PYX_ERR(0, 485, __pyx_L37_except_error)
                      __Pyx_XGOTREF(__pyx_t_14);
                      __Pyx_XGOTREF(__pyx_t_5);
                      __Pyx_XGOTREF(__pyx_t_13);
                      __pyx_t_4 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L37_except_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_4, NULL);
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 485, __pyx_L37_except_error)
                      __Pyx_GOTREF(__pyx_t_25);
                      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_25);
                      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                      if (__pyx_t_1 < (0)) __PYX_ERR(0, 485, __pyx_L37_except_error)
                      __pyx_t_12 = (!__pyx_t_1);
                      if (unlikely(__pyx_t_12)) {
                        __Pyx_GIVEREF(__pyx_t_14);
                        __Pyx_GIVEREF(__pyx_t_5);
                        __Pyx_XGIVEREF(__pyx_t_13);
                        __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_5, __pyx_t_13);
                        __pyx_t_14 = 0;  __pyx_t_5 = 0;  __pyx_t_13 = 0; 
                        __PYX_ERR(0, 485, __pyx_L37_except_error)
                      }
                      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                      goto __pyx_L36_exception_handled;
                    }
                    __pyx_L37_except_error:;
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
                    goto __pyx_L8_error;
                    __pyx_L36_exception_handled:;
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
                    __pyx_L42_try_end:;
                  }
                }
                /*finally:*/ {
                  /*normal exit:*/{
                    if (__pyx_t_21) {
                      __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_mstate_global->__pyx_tuple[0], NULL);
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 485, __pyx_L8_error)
                      __Pyx_GOTREF(__pyx_t_24);
                      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    }
                    goto __pyx_L34;
                  }
                  __pyx_L34:;
                }
                goto __pyx_L47;
                __pyx_L29_error:;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                goto __pyx_L8_error;
                __pyx_L47:;
              }

              /* "asyncpg/protocol/protocol.pyx":487
 *                             with timer:
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)             # <<<<<<<<<<<<<<
 *                             wbuf = WriteBuffer.new()
 *                 else:
*/
              __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 487, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

              /* "asyncpg/protocol/protocol.pyx":488
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
 *                             wbuf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *                 else:
 *                     for row in records:
*/
              __pyx_t_13 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 488, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_wbuf);
              __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_13));
              __Pyx_GIVEREF(__pyx_t_13);
              __pyx_t_13 = 0;

              /* "asyncpg/protocol/protocol.pyx":484
 *                                 codec.encode(settings, wbuf, item)
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:             # <<<<<<<<<<<<<<
 *                             with timer:
 *                                 await self.writing_allowed.wait()
*/
            }

            /* "asyncpg/protocol/protocol.pyx":471
 * 
 *                 if isinstance(records, collections.abc.AsyncIterable):
 *                     async for row in records:             # <<<<<<<<<<<<<<
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)
*/
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "asyncpg/protocol/protocol.pyx":470
 *                             'type {} (OID {})'.format(codec.name, codec.oid))
 * 
 *                 if isinstance(records, collections.abc.AsyncIterable):             # <<<<<<<<<<<<<<
 *                     async for row in records:
 *                         # Tuple header
*/
          goto __pyx_L21;
        }

        /* "asyncpg/protocol/protocol.pyx":490
 *                             wbuf = WriteBuffer.new()
 *                 else:
 *                     for row in records:             # <<<<<<<<<<<<<<
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)
*/
        /*else*/ {
          if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_records)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_records)) {
            __pyx_t_3 = __pyx_cur_scope->__pyx_v_records; __Pyx_INCREF(__pyx_t_3);
            __pyx_t_10 = 0;
            __pyx_t_26 = NULL;
          } else {
            __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_26 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 490, __pyx_L8_error)
          }
          for (;;) {
            if (likely(!__pyx_t_26)) {
              if (likely(PyList_CheckExact(__pyx_t_3))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L8_error)
                  #endif
                  if (__pyx_t_10 >= __pyx_temp) break;
                }
                __pyx_t_13 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
                ++__pyx_t_10;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L8_error)
                  #endif
                  if (__pyx_t_10 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_13 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10));
                #else
                __pyx_t_13 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10);
                #endif
                ++__pyx_t_10;
              }
              if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 490, __pyx_L8_error)
            } else {
              __pyx_t_13 = __pyx_t_26(__pyx_t_3);
              if (unlikely(!__pyx_t_13)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 490, __pyx_L8_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_row);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_row, __pyx_t_13);
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_13 = 0;

            /* "asyncpg/protocol/protocol.pyx":492
 *                     for row in records:
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)             # <<<<<<<<<<<<<<
 *                         # Tuple data
 *                         for i in range(num_cols):
*/
            __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, ((int16_t)__pyx_cur_scope->__pyx_v_num_cols)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 492, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

            /* "asyncpg/protocol/protocol.pyx":494
 *                         wbuf.write_int16(<int16_t>num_cols)
 *                         # Tuple data
 *                         for i in range(num_cols):             # <<<<<<<<<<<<<<
 *                             item = row[i]
 *                             if item is None:
*/
            __pyx_t_17 = __pyx_cur_scope->__pyx_v_num_cols;
            __pyx_t_18 = __pyx_t_17;
            for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
              __pyx_cur_scope->__pyx_v_i = __pyx_t_19;

              /* "asyncpg/protocol/protocol.pyx":495
 *                         # Tuple data
 *                         for i in range(num_cols):
 *                             item = row[i]             # <<<<<<<<<<<<<<
 *                             if item is None:
 *                                 wbuf.write_int32(-1)
*/
              __pyx_t_13 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_row, __pyx_cur_scope->__pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 495, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_item);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_item, __pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_13);
              __pyx_t_13 = 0;

              /* "asyncpg/protocol/protocol.pyx":496
 *                         for i in range(num_cols):
 *                             item = row[i]
 *                             if item is None:             # <<<<<<<<<<<<<<
 *                                 wbuf.write_int32(-1)
 *                             else:
*/
              __pyx_t_12 = (__pyx_cur_scope->__pyx_v_item == Py_None);
              if (__pyx_t_12) {

                /* "asyncpg/protocol/protocol.pyx":497
 *                             item = row[i]
 *                             if item is None:
 *                                 wbuf.write_int32(-1)             # <<<<<<<<<<<<<<
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
*/
                __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int32(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 497, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

                /* "asyncpg/protocol/protocol.pyx":496
 *                         for i in range(num_cols):
 *                             item = row[i]
 *                             if item is None:             # <<<<<<<<<<<<<<
 *                                 wbuf.write_int32(-1)
 *                             else:
*/
                goto __pyx_L53;
              }

              /* "asyncpg/protocol/protocol.pyx":499
 *                                 wbuf.write_int32(-1)
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(             # <<<<<<<<<<<<<<
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)
*/
              /*else*/ {

                /* "asyncpg/protocol/protocol.pyx":500
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
 *                                     codecs, i)             # <<<<<<<<<<<<<<
 *                                 codec.encode(settings, wbuf, item)
 * 
*/
                __pyx_t_20 = PyTuple_GET_ITEM(__pyx_cur_scope->__pyx_v_codecs, __pyx_cur_scope->__pyx_v_i);

                /* "asyncpg/protocol/protocol.pyx":499
 *                                 wbuf.write_int32(-1)
 *                             else:
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(             # <<<<<<<<<<<<<<
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)
*/
                __pyx_t_13 = ((PyObject *)__pyx_t_20);
                __Pyx_INCREF(__pyx_t_13);
                __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_codec);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)__pyx_t_13));
                __Pyx_GIVEREF(__pyx_t_13);
                __pyx_t_13 = 0;

                /* "asyncpg/protocol/protocol.pyx":501
 *                                 codec = <Codec>cpython.PyTuple_GET_ITEM(
 *                                     codecs, i)
 *                                 codec.encode(settings, wbuf, item)             # <<<<<<<<<<<<<<
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
*/
                __pyx_t_13 = __pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode(__pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_settings, __pyx_cur_scope->__pyx_v_wbuf, __pyx_cur_scope->__pyx_v_item); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 501, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              }
              __pyx_L53:;
            }

            /* "asyncpg/protocol/protocol.pyx":503
 *                                 codec.encode(settings, wbuf, item)
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:             # <<<<<<<<<<<<<<
 *                             with timer:
 *                                 await self.writing_allowed.wait()
*/
            __pyx_t_13 = __pyx_f_7asyncpg_7pgproto_7pgproto_11WriteBuffer_len(__pyx_cur_scope->__pyx_v_wbuf); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 503, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, __pyx_mstate_global->__pyx_int_524288, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 503, __pyx_L8_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_12) {

              /* "asyncpg/protocol/protocol.pyx":504
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:             # <<<<<<<<<<<<<<
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
*/
              /*with:*/ {
                __pyx_t_21 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 504, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_21);
                __pyx_t_13 = NULL;
                __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 504, __pyx_L55_error)
                __Pyx_GOTREF(__pyx_t_14);
                __pyx_t_6 = 1;
                #if CYTHON_UNPACK_METHODS
                if (likely(PyMethod_Check(__pyx_t_14))) {
                  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
                  assert(__pyx_t_13);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
                  __pyx_t_6 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
                  __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L55_error)
                  __Pyx_GOTREF(__pyx_t_5);
                }
                __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                /*try:*/ {
                  {
                    __Pyx_ExceptionSave(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
                    __Pyx_XGOTREF(__pyx_t_24);
                    __Pyx_XGOTREF(__pyx_t_23);
                    __Pyx_XGOTREF(__pyx_t_22);
                    /*try:*/ {

                      /* "asyncpg/protocol/protocol.pyx":505
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:
 *                                 await self.writing_allowed.wait()             # <<<<<<<<<<<<<<
 *                             self._write_copy_data_msg(wbuf)
 *                             wbuf = WriteBuffer.new()
*/
                      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 505, __pyx_L61_error)
                      __Pyx_GOTREF(__pyx_t_13);
                      __pyx_t_14 = __pyx_t_13;
                      __Pyx_INCREF(__pyx_t_14);
                      __pyx_t_6 = 0;
                      {
                        PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
                        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L61_error)
                        __Pyx_GOTREF(__pyx_t_5);
                      }
                      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5, &__pyx_r);
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_XGIVEREF(__pyx_t_3);
                        __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
                        __Pyx_XGIVEREF(__pyx_t_7);
                        __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
                        __Pyx_XGIVEREF(__pyx_t_8);
                        __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
                        __Pyx_XGIVEREF(__pyx_t_9);
                        __pyx_cur_scope->__pyx_t_3 = __pyx_t_9;
                        __pyx_cur_scope->__pyx_t_8 = __pyx_t_10;
                        __Pyx_XGIVEREF(__pyx_t_21);
                        __pyx_cur_scope->__pyx_t_4 = __pyx_t_21;
                        __Pyx_XGIVEREF(__pyx_t_22);
                        __pyx_cur_scope->__pyx_t_5 = __pyx_t_22;
                        __Pyx_XGIVEREF(__pyx_t_23);
                        __pyx_cur_scope->__pyx_t_6 = __pyx_t_23;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __pyx_cur_scope->__pyx_t_7 = __pyx_t_24;
                        __pyx_cur_scope->__pyx_t_9 = __pyx_t_26;
                        __Pyx_XGIVEREF(__pyx_r);
                        __Pyx_RefNannyFinishContext();
                        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                        /* return from generator, awaiting value */
                        __pyx_generator->resume_label = 5;
                        return __pyx_r;
                        __pyx_L69_resume_from_await:;
                        __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
                        __pyx_cur_scope->__pyx_t_0 = 0;
                        __Pyx_XGOTREF(__pyx_t_3);
                        __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
                        __pyx_cur_scope->__pyx_t_1 = 0;
                        __Pyx_XGOTREF(__pyx_t_7);
                        __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
                        __pyx_cur_scope->__pyx_t_2 = 0;
                        __Pyx_XGOTREF(__pyx_t_8);
                        __pyx_t_9 = __pyx_cur_scope->__pyx_t_3;
                        __pyx_cur_scope->__pyx_t_3 = 0;
                        __Pyx_XGOTREF(__pyx_t_9);
                        __pyx_t_10 = __pyx_cur_scope->__pyx_t_8;
                        __pyx_t_21 = __pyx_cur_scope->__pyx_t_4;
                        __pyx_cur_scope->__pyx_t_4 = 0;
                        __Pyx_XGOTREF(__pyx_t_21);
                        __pyx_t_22 = __pyx_cur_scope->__pyx_t_5;
                        __pyx_cur_scope->__pyx_t_5 = 0;
                        __Pyx_XGOTREF(__pyx_t_22);
                        __pyx_t_23 = __pyx_cur_scope->__pyx_t_6;
                        __pyx_cur_scope->__pyx_t_6 = 0;
                        __Pyx_XGOTREF(__pyx_t_23);
                        __pyx_t_24 = __pyx_cur_scope->__pyx_t_7;
                        __pyx_cur_scope->__pyx_t_7 = 0;
                        __Pyx_XGOTREF(__pyx_t_24);
                        __pyx_t_26 = __pyx_cur_scope->__pyx_t_9;
                        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 505, __pyx_L61_error)
                      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                      } else {
                        __Pyx_XGOTREF(__pyx_r);
                        __PYX_ERR(0, 505, __pyx_L61_error)
                      }

                      /* "asyncpg/protocol/protocol.pyx":504
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:
 *                             with timer:             # <<<<<<<<<<<<<<
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
*/
                    }
                    __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
                    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                    goto __pyx_L68_try_end;
                    __pyx_L61_error:;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    /*except:*/ {
                      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
                      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_13, &__pyx_t_14) < 0) __PYX_ERR(0, 504, __pyx_L63_except_error)
                      __Pyx_XGOTREF(__pyx_t_5);
                      __Pyx_XGOTREF(__pyx_t_13);
                      __Pyx_XGOTREF(__pyx_t_14);
                      __pyx_t_4 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L63_except_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_4, NULL);
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 504, __pyx_L63_except_error)
                      __Pyx_GOTREF(__pyx_t_25);
                      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_25);
                      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                      if (__pyx_t_12 < (0)) __PYX_ERR(0, 504, __pyx_L63_except_error)
                      __pyx_t_1 = (!__pyx_t_12);
                      if (unlikely(__pyx_t_1)) {
                        __Pyx_GIVEREF(__pyx_t_5);
                        __Pyx_GIVEREF(__pyx_t_13);
                        __Pyx_XGIVEREF(__pyx_t_14);
                        __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_13, __pyx_t_14);
                        __pyx_t_5 = 0;  __pyx_t_13 = 0;  __pyx_t_14 = 0; 
                        __PYX_ERR(0, 504, __pyx_L63_except_error)
                      }
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                      goto __pyx_L62_exception_handled;
                    }
                    __pyx_L63_except_error:;
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
                    goto __pyx_L8_error;
                    __pyx_L62_exception_handled:;
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_XGIVEREF(__pyx_t_23);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_23, __pyx_t_22);
                    __pyx_L68_try_end:;
                  }
                }
                /*finally:*/ {
                  /*normal exit:*/{
                    if (__pyx_t_21) {
                      __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_mstate_global->__pyx_tuple[0], NULL);
                      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                      if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 504, __pyx_L8_error)
                      __Pyx_GOTREF(__pyx_t_22);
                      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                    }
                    goto __pyx_L60;
                  }
                  __pyx_L60:;
                }
                goto __pyx_L73;
                __pyx_L55_error:;
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                goto __pyx_L8_error;
                __pyx_L73:;
              }

              /* "asyncpg/protocol/protocol.pyx":506
 *                             with timer:
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)             # <<<<<<<<<<<<<<
 *                             wbuf = WriteBuffer.new()
 * 
*/
              __pyx_t_14 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 506, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

              /* "asyncpg/protocol/protocol.pyx":507
 *                                 await self.writing_allowed.wait()
 *                             self._write_copy_data_msg(wbuf)
 *                             wbuf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *                 # End of binary copy.
*/
              __pyx_t_14 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->__pyx_new()); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 507, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_wbuf);
              __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_wbuf, ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_14));
              __Pyx_GIVEREF(__pyx_t_14);
              __pyx_t_14 = 0;

              /* "asyncpg/protocol/protocol.pyx":503
 *                                 codec.encode(settings, wbuf, item)
 * 
 *                         if wbuf.len() >= _COPY_BUFFER_SIZE:             # <<<<<<<<<<<<<<
 *                             with timer:
 *                                 await self.writing_allowed.wait()
*/
            }

            /* "asyncpg/protocol/protocol.pyx":490
 *                             wbuf = WriteBuffer.new()
 *                 else:
 *                     for row in records:             # <<<<<<<<<<<<<<
 *                         # Tuple header
 *                         wbuf.write_int16(<int16_t>num_cols)
*/
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_L21:;

        /* "asyncpg/protocol/protocol.pyx":510
 * 
 *                 # End of binary copy.
 *                 wbuf.write_int16(-1)             # <<<<<<<<<<<<<<
 *                 self._write_copy_data_msg(wbuf)
 * 
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_wbuf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_wbuf, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":511
 *                 # End of binary copy.
 *                 wbuf.write_int16(-1)
 *                 self._write_copy_data_msg(wbuf)             # <<<<<<<<<<<<<<
 * 
 *             elif reader is not None:
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject *)__pyx_cur_scope->__pyx_v_wbuf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":448
 * 
 *         try:
 *             if record_stmt is not None:             # <<<<<<<<<<<<<<
 *                 # copy_in_records in binary mode
 *                 wbuf = WriteBuffer.new()
*/
        goto __pyx_L14;
      }

      /* "asyncpg/protocol/protocol.pyx":513
 *                 self._write_copy_data_msg(wbuf)
 * 
 *             elif reader is not None:             # <<<<<<<<<<<<<<
 *                 try:
 *                     aiter = reader.__aiter__
*/
      __pyx_t_1 = (__pyx_cur_scope->__pyx_v_reader != Py_None);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/protocol.pyx":514
 * 
 *             elif reader is not None:
 *                 try:             # <<<<<<<<<<<<<<
 *                     aiter = reader.__aiter__
 *                 except AttributeError:
*/
        {
          __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          /*try:*/ {

            /* "asyncpg/protocol/protocol.pyx":515
 *             elif reader is not None:
 *                 try:
 *                     aiter = reader.__aiter__             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     raise TypeError('reader is not an asynchronous iterable')
*/
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_reader, __pyx_mstate_global->__pyx_n_u_aiter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L75_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_cur_scope->__pyx_v_aiter = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "asyncpg/protocol/protocol.pyx":514
 * 
 *             elif reader is not None:
 *                 try:             # <<<<<<<<<<<<<<
 *                     aiter = reader.__aiter__
 *                 except AttributeError:
*/
          }

          /* "asyncpg/protocol/protocol.pyx":519
 *                     raise TypeError('reader is not an asynchronous iterable')
 *                 else:
 *                     iterator = aiter()             # <<<<<<<<<<<<<<
 * 
 *                 try:
*/
          /*else:*/ {
            __pyx_t_14 = NULL;
            __Pyx_INCREF(__pyx_cur_scope->__pyx_v_aiter);
            __pyx_t_13 = __pyx_cur_scope->__pyx_v_aiter; 
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
              assert(__pyx_t_14);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_14, NULL};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L77_except_error)
              __Pyx_GOTREF(__pyx_t_3);
            }
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_cur_scope->__pyx_v_iterator = __pyx_t_3;
            __pyx_t_3 = 0;
          }
          __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
          goto __pyx_L80_try_end;
          __pyx_L75_error:;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/protocol.pyx":516
 *                 try:
 *                     aiter = reader.__aiter__
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     raise TypeError('reader is not an asynchronous iterable')
 *                 else:
*/
          __pyx_t_27 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError))));
          if (__pyx_t_27) {
            __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_13, &__pyx_t_14) < 0) __PYX_ERR(0, 516, __pyx_L77_except_error)
            __Pyx_XGOTREF(__pyx_t_3);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);

            /* "asyncpg/protocol/protocol.pyx":517
 *                     aiter = reader.__aiter__
 *                 except AttributeError:
 *                     raise TypeError('reader is not an asynchronous iterable')             # <<<<<<<<<<<<<<
 *                 else:
 *                     iterator = aiter()
*/
            __pyx_t_4 = NULL;
            __pyx_t_6 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_reader_is_not_an_asynchronous_it};
              __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L77_except_error)
              __Pyx_GOTREF(__pyx_t_5);
            }
            __Pyx_Raise(__pyx_t_5, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __PYX_ERR(0, 517, __pyx_L77_except_error)
          }
          goto __pyx_L77_except_error;

          /* "asyncpg/protocol/protocol.pyx":514
 * 
 *             elif reader is not None:
 *                 try:             # <<<<<<<<<<<<<<
 *                     aiter = reader.__aiter__
 *                 except AttributeError:
*/
          __pyx_L77_except_error:;
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          goto __pyx_L8_error;
          __pyx_L80_try_end:;
        }

        /* "asyncpg/protocol/protocol.pyx":521
 *                     iterator = aiter()
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     while True:
 *                         # We rely on protocol flow control to moderate the
*/
        {
          __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          /*try:*/ {

            /* "asyncpg/protocol/protocol.pyx":522
 * 
 *                 try:
 *                     while True:             # <<<<<<<<<<<<<<
 *                         # We rely on protocol flow control to moderate the
 *                         # rate of data messages.
*/
            while (1) {

              /* "asyncpg/protocol/protocol.pyx":525
 *                         # We rely on protocol flow control to moderate the
 *                         # rate of data messages.
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             await self.writing_allowed.wait()
 *                         with timer:
*/
              /*with:*/ {
                __pyx_t_24 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 525, __pyx_L83_error)
                __Pyx_GOTREF(__pyx_t_24);
                __pyx_t_13 = NULL;
                __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L91_error)
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_6 = 1;
                #if CYTHON_UNPACK_METHODS
                if (likely(PyMethod_Check(__pyx_t_3))) {
                  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
                  assert(__pyx_t_13);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
                  __pyx_t_6 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
                  __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 525, __pyx_L91_error)
                  __Pyx_GOTREF(__pyx_t_14);
                }
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                /*try:*/ {
                  {
                    __Pyx_ExceptionSave(&__pyx_t_25, &__pyx_t_28, &__pyx_t_29);
                    __Pyx_XGOTREF(__pyx_t_25);
                    __Pyx_XGOTREF(__pyx_t_28);
                    __Pyx_XGOTREF(__pyx_t_29);
                    /*try:*/ {

                      /* "asyncpg/protocol/protocol.pyx":526
 *                         # rate of data messages.
 *                         with timer:
 *                             await self.writing_allowed.wait()             # <<<<<<<<<<<<<<
 *                         with timer:
 *                             chunk = await compat.wait_for(
*/
                      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 526, __pyx_L97_error)
                      __Pyx_GOTREF(__pyx_t_13);
                      __pyx_t_3 = __pyx_t_13;
                      __Pyx_INCREF(__pyx_t_3);
                      __pyx_t_6 = 0;
                      {
                        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
                        __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                        if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 526, __pyx_L97_error)
                        __Pyx_GOTREF(__pyx_t_14);
                      }
                      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14, &__pyx_r);
                      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_XGIVEREF(__pyx_t_7);
                        __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                        __Pyx_XGIVEREF(__pyx_t_8);
                        __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                        __Pyx_XGIVEREF(__pyx_t_9);
                        __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                        __Pyx_XGIVEREF(__pyx_t_21);
                        __pyx_cur_scope->__pyx_t_3 = __pyx_t_21;
                        __Pyx_XGIVEREF(__pyx_t_22);
                        __pyx_cur_scope->__pyx_t_4 = __pyx_t_22;
                        __Pyx_XGIVEREF(__pyx_t_23);
                        __pyx_cur_scope->__pyx_t_5 = __pyx_t_23;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __pyx_cur_scope->__pyx_t_6 = __pyx_t_24;
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __pyx_cur_scope->__pyx_t_7 = __pyx_t_25;
                        __Pyx_XGIVEREF(__pyx_t_28);
                        __pyx_cur_scope->__pyx_t_10 = __pyx_t_28;
                        __Pyx_XGIVEREF(__pyx_t_29);
                        __pyx_cur_scope->__pyx_t_11 = __pyx_t_29;
                        __Pyx_XGIVEREF(__pyx_r);
                        __Pyx_RefNannyFinishContext();
                        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                        /* return from generator, awaiting value */
                        __pyx_generator->resume_label = 6;
                        return __pyx_r;
                        __pyx_L105_resume_from_await:;
                        __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                        __pyx_cur_scope->__pyx_t_0 = 0;
                        __Pyx_XGOTREF(__pyx_t_7);
                        __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                        __pyx_cur_scope->__pyx_t_1 = 0;
                        __Pyx_XGOTREF(__pyx_t_8);
                        __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                        __pyx_cur_scope->__pyx_t_2 = 0;
                        __Pyx_XGOTREF(__pyx_t_9);
                        __pyx_t_21 = __pyx_cur_scope->__pyx_t_3;
                        __pyx_cur_scope->__pyx_t_3 = 0;
                        __Pyx_XGOTREF(__pyx_t_21);
                        __pyx_t_22 = __pyx_cur_scope->__pyx_t_4;
                        __pyx_cur_scope->__pyx_t_4 = 0;
                        __Pyx_XGOTREF(__pyx_t_22);
                        __pyx_t_23 = __pyx_cur_scope->__pyx_t_5;
                        __pyx_cur_scope->__pyx_t_5 = 0;
                        __Pyx_XGOTREF(__pyx_t_23);
                        __pyx_t_24 = __pyx_cur_scope->__pyx_t_6;
                        __pyx_cur_scope->__pyx_t_6 = 0;
                        __Pyx_XGOTREF(__pyx_t_24);
                        __pyx_t_25 = __pyx_cur_scope->__pyx_t_7;
                        __pyx_cur_scope->__pyx_t_7 = 0;
                        __Pyx_XGOTREF(__pyx_t_25);
                        __pyx_t_28 = __pyx_cur_scope->__pyx_t_10;
                        __pyx_cur_scope->__pyx_t_10 = 0;
                        __Pyx_XGOTREF(__pyx_t_28);
                        __pyx_t_29 = __pyx_cur_scope->__pyx_t_11;
                        __pyx_cur_scope->__pyx_t_11 = 0;
                        __Pyx_XGOTREF(__pyx_t_29);
                        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 526, __pyx_L97_error)
                      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_DECREF(__pyx_r); __pyx_r = 0;
                      } else {
                        __Pyx_XGOTREF(__pyx_r);
                        __PYX_ERR(0, 526, __pyx_L97_error)
                      }

                      /* "asyncpg/protocol/protocol.pyx":525
 *                         # We rely on protocol flow control to moderate the
 *                         # rate of data messages.
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             await self.writing_allowed.wait()
 *                         with timer:
*/
                    }
                    __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                    __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                    __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
                    goto __pyx_L104_try_end;
                    __pyx_L97_error:;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    /*except:*/ {
                      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
                      if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_13, &__pyx_t_3) < 0) __PYX_ERR(0, 525, __pyx_L99_except_error)
                      __Pyx_XGOTREF(__pyx_t_14);
                      __Pyx_XGOTREF(__pyx_t_13);
                      __Pyx_XGOTREF(__pyx_t_3);
                      __pyx_t_5 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L99_except_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_5, NULL);
                      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                      if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 525, __pyx_L99_except_error)
                      __Pyx_GOTREF(__pyx_t_30);
                      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_30);
                      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
                      if (__pyx_t_1 < (0)) __PYX_ERR(0, 525, __pyx_L99_except_error)
                      __pyx_t_12 = (!__pyx_t_1);
                      if (unlikely(__pyx_t_12)) {
                        __Pyx_GIVEREF(__pyx_t_14);
                        __Pyx_GIVEREF(__pyx_t_13);
                        __Pyx_XGIVEREF(__pyx_t_3);
                        __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_13, __pyx_t_3);
                        __pyx_t_14 = 0;  __pyx_t_13 = 0;  __pyx_t_3 = 0; 
                        __PYX_ERR(0, 525, __pyx_L99_except_error)
                      }
                      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                      goto __pyx_L98_exception_handled;
                    }
                    __pyx_L99_except_error:;
                    __Pyx_XGIVEREF(__pyx_t_25);
                    __Pyx_XGIVEREF(__pyx_t_28);
                    __Pyx_XGIVEREF(__pyx_t_29);
                    __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_28, __pyx_t_29);
                    goto __pyx_L83_error;
                    __pyx_L98_exception_handled:;
                    __Pyx_XGIVEREF(__pyx_t_25);
                    __Pyx_XGIVEREF(__pyx_t_28);
                    __Pyx_XGIVEREF(__pyx_t_29);
                    __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_28, __pyx_t_29);
                    __pyx_L104_try_end:;
                  }
                }
                /*finally:*/ {
                  /*normal exit:*/{
                    if (__pyx_t_24) {
                      __pyx_t_29 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_mstate_global->__pyx_tuple[0], NULL);
                      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                      if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 525, __pyx_L83_error)
                      __Pyx_GOTREF(__pyx_t_29);
                      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
                    }
                    goto __pyx_L96;
                  }
                  __pyx_L96:;
                }
                goto __pyx_L109;
                __pyx_L91_error:;
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                goto __pyx_L83_error;
                __pyx_L109:;
              }

              /* "asyncpg/protocol/protocol.pyx":527
 *                         with timer:
 *                             await self.writing_allowed.wait()
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             chunk = await compat.wait_for(
 *                                 iterator.__anext__(),
*/
              /*with:*/ {
                __pyx_t_24 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 527, __pyx_L83_error)
                __Pyx_GOTREF(__pyx_t_24);
                __pyx_t_13 = NULL;
                __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_cur_scope->__pyx_v_timer, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 527, __pyx_L110_error)
                __Pyx_GOTREF(__pyx_t_14);
                __pyx_t_6 = 1;
                #if CYTHON_UNPACK_METHODS
                if (likely(PyMethod_Check(__pyx_t_14))) {
                  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
                  assert(__pyx_t_13);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
                  __pyx_t_6 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
                  __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L110_error)
                  __Pyx_GOTREF(__pyx_t_3);
                }
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                /*try:*/ {
                  {
                    __Pyx_ExceptionSave(&__pyx_t_29, &__pyx_t_28, &__pyx_t_25);
                    __Pyx_XGOTREF(__pyx_t_29);
                    __Pyx_XGOTREF(__pyx_t_28);
                    __Pyx_XGOTREF(__pyx_t_25);
                    /*try:*/ {

                      /* "asyncpg/protocol/protocol.pyx":528
 *                             await self.writing_allowed.wait()
 *                         with timer:
 *                             chunk = await compat.wait_for(             # <<<<<<<<<<<<<<
 *                                 iterator.__anext__(),
 *                                 timeout=timer.get_remaining_budget())
*/
                      __pyx_t_14 = NULL;
                      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_compat); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 528, __pyx_L116_error)
                      __Pyx_GOTREF(__pyx_t_13);
                      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_wait_for); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L116_error)
                      __Pyx_GOTREF(__pyx_t_5);
                      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

                      /* "asyncpg/protocol/protocol.pyx":529
 *                         with timer:
 *                             chunk = await compat.wait_for(
 *                                 iterator.__anext__(),             # <<<<<<<<<<<<<<
 *                                 timeout=timer.get_remaining_budget())
 *                         self._write_copy_data_msg(chunk)
*/
                      __pyx_t_4 = __pyx_cur_scope->__pyx_v_iterator;
                      __Pyx_INCREF(__pyx_t_4);
                      __pyx_t_6 = 0;
                      {
                        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
                        __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_anext, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 529, __pyx_L116_error)
                        __Pyx_GOTREF(__pyx_t_13);
                      }

                      /* "asyncpg/protocol/protocol.pyx":530
 *                             chunk = await compat.wait_for(
 *                                 iterator.__anext__(),
 *                                 timeout=timer.get_remaining_budget())             # <<<<<<<<<<<<<<
 *                         self._write_copy_data_msg(chunk)
 *                 except builtins.StopAsyncIteration:
*/
                      __pyx_t_16 = __pyx_cur_scope->__pyx_v_timer;
                      __Pyx_INCREF(__pyx_t_16);
                      __pyx_t_6 = 0;
                      {
                        PyObject *__pyx_callargs[2] = {__pyx_t_16, NULL};
                        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L116_error)
                        __Pyx_GOTREF(__pyx_t_4);
                      }
                      __pyx_t_6 = 1;
                      #if CYTHON_UNPACK_METHODS
                      if (unlikely(PyMethod_Check(__pyx_t_5))) {
                        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
                        assert(__pyx_t_14);
                        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
                        __Pyx_INCREF(__pyx_t_14);
                        __Pyx_INCREF(__pyx__function);
                        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
                        __pyx_t_6 = 0;
                      }
                      #endif
                      {
                        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_14, __pyx_t_13};
                        __pyx_t_16 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 528, __pyx_L116_error)
                        __Pyx_GOTREF(__pyx_t_16);
                        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_timeout, __pyx_t_4, __pyx_t_16, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 528, __pyx_L116_error)
                        __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16);
                        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
                        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L116_error)
                        __Pyx_GOTREF(__pyx_t_3);
                      }
                      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3, &__pyx_r);
                      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
                        __Pyx_GOTREF(__pyx_r);
                        __Pyx_XGIVEREF(__pyx_t_7);
                        __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
                        __Pyx_XGIVEREF(__pyx_t_8);
                        __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                        __Pyx_XGIVEREF(__pyx_t_9);
                        __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
                        __Pyx_XGIVEREF(__pyx_t_21);
                        __pyx_cur_scope->__pyx_t_3 = __pyx_t_21;
                        __Pyx_XGIVEREF(__pyx_t_22);
                        __pyx_cur_scope->__pyx_t_4 = __pyx_t_22;
                        __Pyx_XGIVEREF(__pyx_t_23);
                        __pyx_cur_scope->__pyx_t_5 = __pyx_t_23;
                        __Pyx_XGIVEREF(__pyx_t_24);
                        __pyx_cur_scope->__pyx_t_6 = __pyx_t_24;
                        __Pyx_XGIVEREF(__pyx_t_25);
                        __pyx_cur_scope->__pyx_t_7 = __pyx_t_25;
                        __Pyx_XGIVEREF(__pyx_t_28);
                        __pyx_cur_scope->__pyx_t_10 = __pyx_t_28;
                        __Pyx_XGIVEREF(__pyx_t_29);
                        __pyx_cur_scope->__pyx_t_11 = __pyx_t_29;
                        __Pyx_XGIVEREF(__pyx_r);
                        __Pyx_RefNannyFinishContext();
                        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
                        /* return from generator, awaiting value */
                        __pyx_generator->resume_label = 7;
                        return __pyx_r;
                        __pyx_L124_resume_from_await:;
                        __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
                        __pyx_cur_scope->__pyx_t_0 = 0;
                        __Pyx_XGOTREF(__pyx_t_7);
                        __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                        __pyx_cur_scope->__pyx_t_1 = 0;
                        __Pyx_XGOTREF(__pyx_t_8);
                        __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
                        __pyx_cur_scope->__pyx_t_2 = 0;
                        __Pyx_XGOTREF(__pyx_t_9);
                        __pyx_t_21 = __pyx_cur_scope->__pyx_t_3;
                        __pyx_cur_scope->__pyx_t_3 = 0;
                        __Pyx_XGOTREF(__pyx_t_21);
                        __pyx_t_22 = __pyx_cur_scope->__pyx_t_4;
                        __pyx_cur_scope->__pyx_t_4 = 0;
                        __Pyx_XGOTREF(__pyx_t_22);
                        __pyx_t_23 = __pyx_cur_scope->__pyx_t_5;
                        __pyx_cur_scope->__pyx_t_5 = 0;
                        __Pyx_XGOTREF(__pyx_t_23);
                        __pyx_t_24 = __pyx_cur_scope->__pyx_t_6;
                        __pyx_cur_scope->__pyx_t_6 = 0;
                        __Pyx_XGOTREF(__pyx_t_24);
                        __pyx_t_25 = __pyx_cur_scope->__pyx_t_7;
                        __pyx_cur_scope->__pyx_t_7 = 0;
                        __Pyx_XGOTREF(__pyx_t_25);
                        __pyx_t_28 = __pyx_cur_scope->__pyx_t_10;
                        __pyx_cur_scope->__pyx_t_10 = 0;
                        __Pyx_XGOTREF(__pyx_t_28);
                        __pyx_t_29 = __pyx_cur_scope->__pyx_t_11;
                        __pyx_cur_scope->__pyx_t_11 = 0;
                        __Pyx_XGOTREF(__pyx_t_29);
                        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 528, __pyx_L116_error)
                        __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
                      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
                        __Pyx_GOTREF(__pyx_r);
                        __pyx_t_3 = __pyx_r; __pyx_r = NULL;
                      } else {
                        __Pyx_XGOTREF(__pyx_r);
                        __PYX_ERR(0, 528, __pyx_L116_error)
                      }
                      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk);
                      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_3);
                      __Pyx_GIVEREF(__pyx_t_3);
                      __pyx_t_3 = 0;

                      /* "asyncpg/protocol/protocol.pyx":527
 *                         with timer:
 *                             await self.writing_allowed.wait()
 *                         with timer:             # <<<<<<<<<<<<<<
 *                             chunk = await compat.wait_for(
 *                                 iterator.__anext__(),
*/
                    }
                    __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
                    __Pyx_XDECREF(__pyx_t_28); __pyx_t_28 = 0;
                    __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
                    goto __pyx_L123_try_end;
                    __pyx_L116_error:;
                    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                    /*except:*/ {
                      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
                      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_16) < 0) __PYX_ERR(0, 527, __pyx_L118_except_error)
                      __Pyx_XGOTREF(__pyx_t_3);
                      __Pyx_XGOTREF(__pyx_t_5);
                      __Pyx_XGOTREF(__pyx_t_16);
                      __pyx_t_4 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_5, __pyx_t_16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L118_except_error)
                      __Pyx_GOTREF(__pyx_t_4);
                      __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_4, NULL);
                      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 527, __pyx_L118_except_error)
                      __Pyx_GOTREF(__pyx_t_30);
                      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_30);
                      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
                      if (__pyx_t_12 < (0)) __PYX_ERR(0, 527, __pyx_L118_except_error)
                      __pyx_t_1 = (!__pyx_t_12);
                      if (unlikely(__pyx_t_1)) {
                        __Pyx_GIVEREF(__pyx_t_3);
                        __Pyx_GIVEREF(__pyx_t_5);
                        __Pyx_XGIVEREF(__pyx_t_16);
                        __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_5, __pyx_t_16);
                        __pyx_t_3 = 0;  __pyx_t_5 = 0;  __pyx_t_16 = 0; 
                        __PYX_ERR(0, 527, __pyx_L118_except_error)
                      }
                      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
                      goto __pyx_L117_exception_handled;
                    }
                    __pyx_L118_except_error:;
                    __Pyx_XGIVEREF(__pyx_t_29);
                    __Pyx_XGIVEREF(__pyx_t_28);
                    __Pyx_XGIVEREF(__pyx_t_25);
                    __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_28, __pyx_t_25);
                    goto __pyx_L83_error;
                    __pyx_L117_exception_handled:;
                    __Pyx_XGIVEREF(__pyx_t_29);
                    __Pyx_XGIVEREF(__pyx_t_28);
                    __Pyx_XGIVEREF(__pyx_t_25);
                    __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_28, __pyx_t_25);
                    __pyx_L123_try_end:;
                  }
                }
                /*finally:*/ {
                  /*normal exit:*/{
                    if (__pyx_t_24) {
                      __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_mstate_global->__pyx_tuple[0], NULL);
                      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                      if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 527, __pyx_L83_error)
                      __Pyx_GOTREF(__pyx_t_25);
                      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                    }
                    goto __pyx_L115;
                  }
                  __pyx_L115:;
                }
                goto __pyx_L128;
                __pyx_L110_error:;
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                goto __pyx_L83_error;
                __pyx_L128:;
              }

              /* "asyncpg/protocol/protocol.pyx":531
 *                                 iterator.__anext__(),
 *                                 timeout=timer.get_remaining_budget())
 *                         self._write_copy_data_msg(chunk)             # <<<<<<<<<<<<<<
 *                 except builtins.StopAsyncIteration:
 *                     pass
*/
              if (unlikely(!__pyx_cur_scope->__pyx_v_chunk)) { __Pyx_RaiseUnboundLocalError("chunk"); __PYX_ERR(0, 531, __pyx_L83_error) }
              __pyx_t_16 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 531, __pyx_L83_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            }

            /* "asyncpg/protocol/protocol.pyx":521
 *                     iterator = aiter()
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     while True:
 *                         # We rely on protocol flow control to moderate the
*/
          }
          __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
          goto __pyx_L88_try_end;
          __pyx_L83_error:;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "asyncpg/protocol/protocol.pyx":532
 *                                 timeout=timer.get_remaining_budget())
 *                         self._write_copy_data_msg(chunk)
 *                 except builtins.StopAsyncIteration:             # <<<<<<<<<<<<<<
 *                     pass
 *             else:
*/
          __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_5, &__pyx_t_3);
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_builtins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L85_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_StopAsyncIteration); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 532, __pyx_L85_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_27 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_16, __pyx_t_13);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_5, __pyx_t_3);
          __pyx_t_16 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0;
          if (__pyx_t_27) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L84_exception_handled;
          }
          goto __pyx_L85_except_error;

          /* "asyncpg/protocol/protocol.pyx":521
 *                     iterator = aiter()
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     while True:
 *                         # We rely on protocol flow control to moderate the
*/
          __pyx_L85_except_error:;
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          goto __pyx_L8_error;
          __pyx_L84_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __pyx_L88_try_end:;
        }

        /* "asyncpg/protocol/protocol.pyx":513
 *                 self._write_copy_data_msg(wbuf)
 * 
 *             elif reader is not None:             # <<<<<<<<<<<<<<
 *                 try:
 *                     aiter = reader.__aiter__
*/
        goto __pyx_L14;
      }

      /* "asyncpg/protocol/protocol.pyx":536
 *             else:
 *                 # Buffer passed in directly.
 *                 await self.writing_allowed.wait()             # <<<<<<<<<<<<<<
 *                 self._write_copy_data_msg(data)
 * 
*/
      /*else*/ {
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 536, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_5 = __pyx_t_16;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wait, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3, &__pyx_r);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_7);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_7;
          __Pyx_XGIVEREF(__pyx_t_8);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
          __Pyx_XGIVEREF(__pyx_t_9);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_9;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 8;
          return __pyx_r;
          __pyx_L131_resume_from_await:;
          __pyx_t_7 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_9 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_9);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 536, __pyx_L8_error)
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_DECREF(__pyx_r); __pyx_r = 0;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 536, __pyx_L8_error)
        }

        /* "asyncpg/protocol/protocol.pyx":537
 *                 # Buffer passed in directly.
 *                 await self.writing_allowed.wait()
 *                 self._write_copy_data_msg(data)             # <<<<<<<<<<<<<<
 * 
 *         except asyncio.TimeoutError:
*/
        __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_data_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L14:;

      /* "asyncpg/protocol/protocol.pyx":447
 *         self._copy_in(copy_stmt)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if record_stmt is not None:
 *                 # copy_in_records in binary mode
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L13_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/protocol.pyx":539
 *                 self._write_copy_data_msg(data)
 * 
 *         except asyncio.TimeoutError:             # <<<<<<<<<<<<<<
 *             self._write_copy_fail_msg('TimeoutError')
 *             self._on_timeout(self.waiter)
*/
    __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_16, &__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 539, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_27 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_ErrRestore(__pyx_t_3, __pyx_t_16, __pyx_t_5);
    __pyx_t_3 = 0; __pyx_t_16 = 0; __pyx_t_5 = 0;
    if (__pyx_t_27) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_16, &__pyx_t_3) < 0) __PYX_ERR(0, 539, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_3);

      /* "asyncpg/protocol/protocol.pyx":540
 * 
 *         except asyncio.TimeoutError:
 *             self._write_copy_fail_msg('TimeoutError')             # <<<<<<<<<<<<<<
 *             self._on_timeout(self.waiter)
 *             try:
*/
      __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_fail_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L10_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/protocol.pyx":541
 *         except asyncio.TimeoutError:
 *             self._write_copy_fail_msg('TimeoutError')
 *             self._on_timeout(self.waiter)             # <<<<<<<<<<<<<<
 *             try:
 *                 await waiter
*/
      __pyx_t_13 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
      __Pyx_INCREF(__pyx_t_13);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_cur_scope->__pyx_v_self->waiter};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_on_timeout, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/protocol.pyx":542
 *             self._write_copy_fail_msg('TimeoutError')
 *             self._on_timeout(self.waiter)
 *             try:             # <<<<<<<<<<<<<<
 *                 await waiter
 *             except TimeoutError:
*/
      {
        __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
        __Pyx_XGOTREF(__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_22);
        __Pyx_XGOTREF(__pyx_t_23);
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":543
 *             self._on_timeout(self.waiter)
 *             try:
 *                 await waiter             # <<<<<<<<<<<<<<
 *             except TimeoutError:
 *                 raise
*/
          __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
          if (likely(__pyx_t_2 == PYGEN_NEXT)) {
            __Pyx_GOTREF(__pyx_r);
            __Pyx_XGIVEREF(__pyx_t_3);
            __pyx_cur_scope->__pyx_t_0 = __pyx_t_3;
            __Pyx_XGIVEREF(__pyx_t_5);
            __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
            __Pyx_XGIVEREF(__pyx_t_7);
            __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
            __Pyx_XGIVEREF(__pyx_t_8);
            __pyx_cur_scope->__pyx_t_3 = __pyx_t_8;
            __Pyx_XGIVEREF(__pyx_t_9);
            __pyx_cur_scope->__pyx_t_4 = __pyx_t_9;
            __Pyx_XGIVEREF(__pyx_t_16);
            __pyx_cur_scope->__pyx_t_5 = __pyx_t_16;
            __Pyx_XGIVEREF(__pyx_t_21);
            __pyx_cur_scope->__pyx_t_6 = __pyx_t_21;
            __Pyx_XGIVEREF(__pyx_t_22);
            __pyx_cur_scope->__pyx_t_7 = __pyx_t_22;
            __Pyx_XGIVEREF(__pyx_t_23);
            __pyx_cur_scope->__pyx_t_10 = __pyx_t_23;
            __Pyx_XGIVEREF(__pyx_r);
            __Pyx_RefNannyFinishContext();
            __Pyx_Coroutine_SwapException(__pyx_generator);
            /* return from generator, awaiting value */
            __pyx_generator->resume_label = 9;
            return __pyx_r;
            __pyx_L142_resume_from_await:;
            __pyx_t_3 = __pyx_cur_scope->__pyx_t_0;
            __pyx_cur_scope->__pyx_t_0 = 0;
            __Pyx_XGOTREF(__pyx_t_3);
            __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
            __pyx_cur_scope->__pyx_t_1 = 0;
            __Pyx_XGOTREF(__pyx_t_5);
            __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
            __pyx_cur_scope->__pyx_t_2 = 0;
            __Pyx_XGOTREF(__pyx_t_7);
            __pyx_t_8 = __pyx_cur_scope->__pyx_t_3;
            __pyx_cur_scope->__pyx_t_3 = 0;
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_9 = __pyx_cur_scope->__pyx_t_4;
            __pyx_cur_scope->__pyx_t_4 = 0;
            __Pyx_XGOTREF(__pyx_t_9);
            __pyx_t_16 = __pyx_cur_scope->__pyx_t_5;
            __pyx_cur_scope->__pyx_t_5 = 0;
            __Pyx_XGOTREF(__pyx_t_16);
            __pyx_t_21 = __pyx_cur_scope->__pyx_t_6;
            __pyx_cur_scope->__pyx_t_6 = 0;
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_22 = __pyx_cur_scope->__pyx_t_7;
            __pyx_cur_scope->__pyx_t_7 = 0;
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_23 = __pyx_cur_scope->__pyx_t_10;
            __pyx_cur_scope->__pyx_t_10 = 0;
            __Pyx_XGOTREF(__pyx_t_23);
            if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 543, __pyx_L134_error)
          } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
            __Pyx_GOTREF(__pyx_r);
            __Pyx_DECREF(__pyx_r); __pyx_r = 0;
          } else {
            __Pyx_XGOTREF(__pyx_r);
            __PYX_ERR(0, 543, __pyx_L134_error)
          }

          /* "asyncpg/protocol/protocol.pyx":542
 *             self._write_copy_fail_msg('TimeoutError')
 *             self._on_timeout(self.waiter)
 *             try:             # <<<<<<<<<<<<<<
 *                 await waiter
 *             except TimeoutError:
*/
        }

        /* "asyncpg/protocol/protocol.pyx":547
 *                 raise
 *             else:
 *                 raise apg_exc.InternalClientError('TimoutError was not raised')             # <<<<<<<<<<<<<<
 * 
 *         except (Exception, asyncio.CancelledError) as e:
*/
        /*else:*/ {
          __pyx_t_13 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 547, __pyx_L136_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L136_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_6 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_15))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
            assert(__pyx_t_13);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
            __pyx_t_6 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_mstate_global->__pyx_kp_u_TimoutError_was_not_raised};
            __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L136_except_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_Raise(__pyx_t_4, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __PYX_ERR(0, 547, __pyx_L136_except_error)
        }
        __pyx_L134_error:;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "asyncpg/protocol/protocol.pyx":544
 *             try:
 *                 await waiter
 *             except TimeoutError:             # <<<<<<<<<<<<<<
 *                 raise
 *             else:
*/
        __pyx_t_27 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TimeoutError))));
        if (__pyx_t_27) {
          __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_15, &__pyx_t_13) < 0) __PYX_ERR(0, 544, __pyx_L136_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);

          /* "asyncpg/protocol/protocol.pyx":545
 *                 await waiter
 *             except TimeoutError:
 *                 raise             # <<<<<<<<<<<<<<
 *             else:
 *                 raise apg_exc.InternalClientError('TimoutError was not raised')
*/
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_15, __pyx_t_13);
          __pyx_t_4 = 0;  __pyx_t_15 = 0;  __pyx_t_13 = 0; 
          __PYX_ERR(0, 545, __pyx_L136_except_error)
        }
        goto __pyx_L136_except_error;

        /* "asyncpg/protocol/protocol.pyx":542
 *             self._write_copy_fail_msg('TimeoutError')
 *             self._on_timeout(self.waiter)
 *             try:             # <<<<<<<<<<<<<<
 *                 await waiter
 *             except TimeoutError:
*/
        __pyx_L136_except_error:;
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_XGIVEREF(__pyx_t_23);
        __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
        goto __pyx_L10_except_error;
      }
    }

    /* "asyncpg/protocol/protocol.pyx":549
 *                 raise apg_exc.InternalClientError('TimoutError was not raised')
 * 
 *         except (Exception, asyncio.CancelledError) as e:             # <<<<<<<<<<<<<<
 *             self._write_copy_fail_msg(str(e))
 *             self._request_cancel()
*/
    __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_16, &__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 549, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_CancelledError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 549, __pyx_L10_except_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_27 = __Pyx_PyErr_GivenExceptionMatches2(__pyx_t_3, ((PyObject *)(((PyTypeObject*)PyExc_Exception))), __pyx_t_15);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_ErrRestore(__pyx_t_3, __pyx_t_16, __pyx_t_5);
    __pyx_t_3 = 0; __pyx_t_16 = 0; __pyx_t_5 = 0;
    if (__pyx_t_27) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_16, &__pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L10_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_16);
      __pyx_cur_scope->__pyx_v_e = __pyx_t_16;
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":550
 * 
 *         except (Exception, asyncio.CancelledError) as e:
 *             self._write_copy_fail_msg(str(e))             # <<<<<<<<<<<<<<
 *             self._request_cancel()
 *             # Make asyncio shut up about unretrieved QueryCanceledError
*/
        __pyx_t_15 = __Pyx_PyObject_Unicode(__pyx_cur_scope->__pyx_v_e); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 550, __pyx_L150_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_13 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_fail_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_15)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 550, __pyx_L150_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "asyncpg/protocol/protocol.pyx":551
 *         except (Exception, asyncio.CancelledError) as e:
 *             self._write_copy_fail_msg(str(e))
 *             self._request_cancel()             # <<<<<<<<<<<<<<
 *             # Make asyncio shut up about unretrieved QueryCanceledError
 *             waiter.add_done_callback(lambda f: f.exception())
*/
        __pyx_t_15 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 551, __pyx_L150_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "asyncpg/protocol/protocol.pyx":553
 *             self._request_cancel()
 *             # Make asyncio shut up about unretrieved QueryCanceledError
 *             waiter.add_done_callback(lambda f: f.exception())             # <<<<<<<<<<<<<<
 *             raise
 * 
*/
        __pyx_t_15 = __pyx_cur_scope->__pyx_v_waiter;
        __Pyx_INCREF(__pyx_t_15);
        __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7copy_in_lambda7, 0, __pyx_mstate_global->__pyx_n_u_copy_in_locals_lambda, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L150_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_4};
          __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 553, __pyx_L150_error)
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "asyncpg/protocol/protocol.pyx":554
 *             # Make asyncio shut up about unretrieved QueryCanceledError
 *             waiter.add_done_callback(lambda f: f.exception())
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         self._write_copy_done_msg()
*/
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_16, __pyx_t_3);
        __pyx_t_5 = 0;  __pyx_t_16 = 0;  __pyx_t_3 = 0; 
        __PYX_ERR(0, 554, __pyx_L150_error)
      }

      /* "asyncpg/protocol/protocol.pyx":549
 *                 raise apg_exc.InternalClientError('TimoutError was not raised')
 * 
 *         except (Exception, asyncio.CancelledError) as e:             # <<<<<<<<<<<<<<
 *             self._write_copy_fail_msg(str(e))
 *             self._request_cancel()
*/
      /*finally:*/ {
        __pyx_L150_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_assign
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_28 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_28);
          if ( unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_24);
          __Pyx_XGOTREF(__pyx_t_25);
          __Pyx_XGOTREF(__pyx_t_28);
          __pyx_t_27 = __pyx_lineno; __pyx_t_31 = __pyx_clineno; __pyx_t_32 = __pyx_filename;
          {
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_e);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_e); __pyx_cur_scope->__pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_XGIVEREF(__pyx_t_28);
          __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_28);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
          __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_28 = 0;
          __pyx_lineno = __pyx_t_27; __pyx_clineno = __pyx_t_31; __pyx_filename = __pyx_t_32;
          goto __pyx_L10_except_error;
        }
      }
    }
    goto __pyx_L10_except_error;

    /* "asyncpg/protocol/protocol.pyx":447
 *         self._copy_in(copy_stmt)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if record_stmt is not None:
 *                 # copy_in_records in binary mode
*/
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L13_try_end:;
  }

  /* "asyncpg/protocol/protocol.pyx":556
 *             raise
 * 
 *         self._write_copy_done_msg()             # <<<<<<<<<<<<<<
 * 
 *         status_msg = await waiter
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write_copy_done_msg(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":558
 *         self._write_copy_done_msg()
 * 
 *         status_msg = await waiter             # <<<<<<<<<<<<<<
 * 
 *         return status_msg
*/
  __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
  if (likely(__pyx_t_2 == PYGEN_NEXT)) {
    __Pyx_GOTREF(__pyx_r);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 10;
    return __pyx_r;
    __pyx_L156_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 558, __pyx_L1_error)
    __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3);
  } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
    __Pyx_GOTREF(__pyx_r);
    __pyx_t_3 = __pyx_r; __pyx_r = NULL;
  } else {
    __Pyx_XGOTREF(__pyx_r);
    __PYX_ERR(0, 558, __pyx_L1_error)
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_status_msg = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":560
 *         status_msg = await waiter
 * 
 *         return status_msg             # <<<<<<<<<<<<<<
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_status_msg);
  __pyx_r = __pyx_cur_scope->__pyx_v_status_msg;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":424
 *         return status_msg
 * 
 *     async def copy_in(self, copy_stmt, reader, data,             # <<<<<<<<<<<<<<
 *                       records, PreparedStatementState record_stmt, timeout):
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":562
 *         return status_msg
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement = {"close_statement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state = 0;
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_statement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 562, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 562, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 562, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close_statement", 0) < (0)) __PYX_ERR(0, 562, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, i); __PYX_ERR(0, 562, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 562, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 562, __pyx_L3_error)
    }
    __pyx_v_state = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)values[0]);
    __pyx_v_timeout = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("close_statement", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 562, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, 1, "state", 0))) __PYX_ERR(0, 562, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_state, __pyx_v_timeout);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_37close_statement(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *__pyx_v_state, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close_statement", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 562, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_state = __pyx_v_state;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_state);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close_statement, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_statement, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_statement", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    case 3: goto __pyx_L29_resume_from_await;
    case 4: goto __pyx_L32_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 562, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":563
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":564
 *     async def close_statement(self, PreparedStatementState state, timeout):
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 564, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 564, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":563
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":565
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":566
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 566, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 566, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":567
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         self._check_state()
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":565
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":569
 *             self.cancel_sent_waiter = None
 * 
 *         self._check_state()             # <<<<<<<<<<<<<<
 * 
 *         if state.refs != 0:
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_check_state(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":571
 *         self._check_state()
 * 
 *         if state.refs != 0:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError(
 *                 'cannot close prepared statement; refs == {} != 0'.format(
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_state->refs != 0);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/protocol.pyx":572
 * 
 *         if state.refs != 0:
 *             raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                 'cannot close prepared statement; refs == {} != 0'.format(
 *                     state.refs))
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/protocol.pyx":573
 *         if state.refs != 0:
 *             raise apg_exc.InternalClientError(
 *                 'cannot close prepared statement; refs == {} != 0'.format(             # <<<<<<<<<<<<<<
 *                     state.refs))
 * 
*/
    __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_cannot_close_prepared_statement;
    __Pyx_INCREF(__pyx_t_7);

    /* "asyncpg/protocol/protocol.pyx":574
 *             raise apg_exc.InternalClientError(
 *                 'cannot close prepared statement; refs == {} != 0'.format(
 *                     state.refs))             # <<<<<<<<<<<<<<
 * 
 *         timeout = self._get_timeout_impl(timeout)
*/
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_cur_scope->__pyx_v_state->refs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 572, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":571
 *         self._check_state()
 * 
 *         if state.refs != 0:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError(
 *                 'cannot close prepared statement; refs == {} != 0'.format(
*/
  }

  /* "asyncpg/protocol/protocol.pyx":576
 *                     state.refs))
 * 
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 *         waiter = self._new_waiter(timeout)
 *         try:
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":577
 * 
 *         timeout = self._get_timeout_impl(timeout)
 *         waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         try:
 *             self._close(state.name, False)  # network op
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":578
 *         timeout = self._get_timeout_impl(timeout)
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(state.name, False)  # network op
 *             state.closed = True
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":579
 *         waiter = self._new_waiter(timeout)
 *         try:
 *             self._close(state.name, False)  # network op             # <<<<<<<<<<<<<<
 *             state.closed = True
 *         except Exception as ex:
*/
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_state->name;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_6 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self), ((PyObject*)__pyx_t_3), 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "asyncpg/protocol/protocol.pyx":580
 *         try:
 *             self._close(state.name, False)  # network op
 *             state.closed = True             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             waiter.set_exception(ex)
*/
        __pyx_cur_scope->__pyx_v_state->closed = 1;

        /* "asyncpg/protocol/protocol.pyx":578
 *         timeout = self._get_timeout_impl(timeout)
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(state.name, False)  # network op
 *             state.closed = True
*/
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L17_try_end;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "asyncpg/protocol/protocol.pyx":581
 *             self._close(state.name, False)  # network op
 *             state.closed = True
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
      __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
      if (__pyx_t_13) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close_statement", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 581, __pyx_L14_except_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_cur_scope->__pyx_v_ex = __pyx_t_3;
        /*try:*/ {

          /* "asyncpg/protocol/protocol.pyx":582
 *             state.closed = True
 *         except Exception as ex:
 *             waiter.set_exception(ex)             # <<<<<<<<<<<<<<
 *             self._coreproto_error()
 *         finally:
*/
          __pyx_t_8 = __pyx_cur_scope->__pyx_v_waiter;
          __Pyx_INCREF(__pyx_t_8);
          __pyx_t_9 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_ex};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "asyncpg/protocol/protocol.pyx":583
 *         except Exception as ex:
 *             waiter.set_exception(ex)
 *             self._coreproto_error()             # <<<<<<<<<<<<<<
 *         finally:
 *             return await waiter
*/
          __pyx_t_4 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_coreproto_error(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L23_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }

        /* "asyncpg/protocol/protocol.pyx":581
 *             self._close(state.name, False)  # network op
 *             state.closed = True
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(ex)
 *             self._coreproto_error()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
            __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            goto __pyx_L24;
          }
          __pyx_L23_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
              __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L14_except_error;
          }
          __pyx_L24:;
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L13_exception_handled;
      }
      goto __pyx_L14_except_error;

      /* "asyncpg/protocol/protocol.pyx":578
 *         timeout = self._get_timeout_impl(timeout)
 *         waiter = self._new_waiter(timeout)
 *         try:             # <<<<<<<<<<<<<<
 *             self._close(state.name, False)  # network op
 *             state.closed = True
*/
      __pyx_L14_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L10_error;
      __pyx_L13_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_L17_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":585
 *             self._coreproto_error()
 *         finally:
 *             return await waiter             # <<<<<<<<<<<<<<
 * 
 *     def is_closed(self):
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 3;
        return __pyx_r;
        __pyx_L29_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 585, __pyx_L1_error)
        __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5);
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __pyx_t_5 = __pyx_r; __pyx_r = NULL;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 585, __pyx_L1_error)
      }
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
    __pyx_L10_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
      if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_19);
      {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_10);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_10;
          __Pyx_XGIVEREF(__pyx_t_11);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_11;
          __Pyx_XGIVEREF(__pyx_t_12);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_12;
          __Pyx_XGIVEREF(__pyx_t_19);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_19;
          __Pyx_XGIVEREF(__pyx_t_20);
          __pyx_cur_scope->__pyx_t_4 = __pyx_t_20;
          __Pyx_XGIVEREF(__pyx_t_21);
          __pyx_cur_scope->__pyx_t_5 = __pyx_t_21;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 4;
          return __pyx_r;
          __pyx_L32_resume_from_await:;
          __pyx_t_10 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_10);
          __pyx_t_11 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_11);
          __pyx_t_12 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_19 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_20 = __pyx_cur_scope->__pyx_t_4;
          __pyx_cur_scope->__pyx_t_4 = 0;
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_21 = __pyx_cur_scope->__pyx_t_5;
          __pyx_cur_scope->__pyx_t_5 = 0;
          __Pyx_XGOTREF(__pyx_t_21);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 585, __pyx_L31_error)
          __pyx_t_5 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_5);
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __pyx_t_5 = __pyx_r; __pyx_r = NULL;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 585, __pyx_L31_error)
        }
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L30_return;
      }
      __pyx_L30_return:;
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      goto __pyx_L0;
      __pyx_L31_error:;
      __Pyx_XGIVEREF(__pyx_t_21);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
      goto __pyx_L1_error;
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":562
 *         return status_msg
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/

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

/* "asyncpg/protocol/protocol.pyx":587
 *             return await waiter
 * 
 *     def is_closed(self):             # <<<<<<<<<<<<<<
 *         return self.closing
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed = {"is_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_closed (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_closed", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_closed", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_40is_closed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":588
 * 
 *     def is_closed(self):
 *         return self.closing             # <<<<<<<<<<<<<<
 * 
 *     def is_connected(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":587
 *             return await waiter
 * 
 *     def is_closed(self):             # <<<<<<<<<<<<<<
 *         return self.closing
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":590
 *         return self.closing
 * 
 *     def is_connected(self):             # <<<<<<<<<<<<<<
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected = {"is_connected", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_connected (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_connected", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_connected", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_42is_connected(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":591
 * 
 *     def is_connected(self):
 *         return not self.closing and self.con_status == CONNECTION_OK             # <<<<<<<<<<<<<<
 * 
 *     def abort(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (!__pyx_v_self->closing);
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->__pyx_base.con_status == __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_OK);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":590
 *         return self.closing
 * 
 *     def is_connected(self):             # <<<<<<<<<<<<<<
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":593
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
 *     def abort(self):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort = {"abort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("abort", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("abort", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_44abort(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abort", 0);

  /* "asyncpg/protocol/protocol.pyx":594
 * 
 *     def abort(self):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             return
 *         self.closing = True
*/
  if (__pyx_v_self->closing) {

    /* "asyncpg/protocol/protocol.pyx":595
 *     def abort(self):
 *         if self.closing:
 *             return             # <<<<<<<<<<<<<<
 *         self.closing = True
 *         self._handle_waiter_on_connection_lost(None)
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":594
 * 
 *     def abort(self):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             return
 *         self.closing = True
*/
  }

  /* "asyncpg/protocol/protocol.pyx":596
 *         if self.closing:
 *             return
 *         self.closing = True             # <<<<<<<<<<<<<<
 *         self._handle_waiter_on_connection_lost(None)
 *         self._terminate()
*/
  __pyx_v_self->closing = 1;

  /* "asyncpg/protocol/protocol.pyx":597
 *             return
 *         self.closing = True
 *         self._handle_waiter_on_connection_lost(None)             # <<<<<<<<<<<<<<
 *         self._terminate()
 *         self.transport.abort()
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_waiter_on_connection_lost(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":598
 *         self.closing = True
 *         self._handle_waiter_on_connection_lost(None)
 *         self._terminate()             # <<<<<<<<<<<<<<
 *         self.transport.abort()
 *         self.transport = None
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._terminate(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":599
 *         self._handle_waiter_on_connection_lost(None)
 *         self._terminate()
 *         self.transport.abort()             # <<<<<<<<<<<<<<
 *         self.transport = None
 * 
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base.transport;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":600
 *         self._terminate()
 *         self.transport.abort()
 *         self.transport = None             # <<<<<<<<<<<<<<
 * 
 *     async def close(self, timeout):
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.transport);
  __pyx_v_self->__pyx_base.transport = Py_None;

  /* "asyncpg/protocol/protocol.pyx":593
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
 *     def abort(self):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.abort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":602
 *         self.transport = None
 * 
 *     async def close(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_47close = {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 602, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "close", 0) < (0)) __PYX_ERR(0, 602, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, i); __PYX_ERR(0, 602, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 602, __pyx_L3_error)
    }
    __pyx_v_timeout = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("close", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 602, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_timeout);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_46close(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 602, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_timeout = __pyx_v_timeout;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_timeout);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_close, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_48generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_await;
    case 2: goto __pyx_L8_resume_from_await;
    case 3: goto __pyx_L10_resume_from_await;
    case 4: goto __pyx_L12_resume_from_await;
    case 5: goto __pyx_L22_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 602, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":603
 * 
 *     async def close(self, timeout):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  if (__pyx_cur_scope->__pyx_v_self->closing) {

    /* "asyncpg/protocol/protocol.pyx":604
 *     async def close(self, timeout):
 *         if self.closing:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.closing = True
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":603
 * 
 *     async def close(self, timeout):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":606
 *             return
 * 
 *         self.closing = True             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_sent_waiter is not None:
*/
  __pyx_cur_scope->__pyx_v_self->closing = 1;

  /* "asyncpg/protocol/protocol.pyx":608
 *         self.closing = True
 * 
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":609
 * 
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 * 
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L6_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 609, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 609, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":610
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":608
 *         self.closing = True
 * 
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":612
 *             self.cancel_sent_waiter = None
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 * 
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":613
 * 
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 * 
 *         if self.waiter is not None:
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L8_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 613, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 613, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":612
 *             self.cancel_sent_waiter = None
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":615
 *             await self.cancel_waiter
 * 
 *         if self.waiter is not None:             # <<<<<<<<<<<<<<
 *             # If there is a query running, cancel it
 *             self._request_cancel()
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":617
 *         if self.waiter is not None:
 *             # If there is a query running, cancel it
 *             self._request_cancel()             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
    __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/protocol.pyx":618
 *             # If there is a query running, cancel it
 *             self._request_cancel()
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 *             if self.cancel_waiter is not None:
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L10_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 618, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 618, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":619
 *             self._request_cancel()
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 *             if self.cancel_waiter is not None:
 *                 await self.cancel_waiter
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":620
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
 *             if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *                 await self.cancel_waiter
 * 
*/
    __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/protocol.pyx":621
 *             self.cancel_sent_waiter = None
 *             if self.cancel_waiter is not None:
 *                 await self.cancel_waiter             # <<<<<<<<<<<<<<
 * 
 *         assert self.waiter is None
*/
      __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
      if (likely(__pyx_t_2 == PYGEN_NEXT)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 4;
        return __pyx_r;
        __pyx_L12_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 621, __pyx_L1_error)
      } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
        __Pyx_GOTREF(__pyx_r);
        __Pyx_DECREF(__pyx_r); __pyx_r = 0;
      } else {
        __Pyx_XGOTREF(__pyx_r);
        __PYX_ERR(0, 621, __pyx_L1_error)
      }

      /* "asyncpg/protocol/protocol.pyx":620
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
 *             if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *                 await self.cancel_waiter
 * 
*/
    }

    /* "asyncpg/protocol/protocol.pyx":615
 *             await self.cancel_waiter
 * 
 *         if self.waiter is not None:             # <<<<<<<<<<<<<<
 *             # If there is a query running, cancel it
 *             self._request_cancel()
*/
  }

  /* "asyncpg/protocol/protocol.pyx":623
 *                 await self.cancel_waiter
 * 
 *         assert self.waiter is None             # <<<<<<<<<<<<<<
 * 
 *         timeout = self._get_timeout_impl(timeout)
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->waiter == Py_None);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(0, 623, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(0, 623, __pyx_L1_error)
  #endif

  /* "asyncpg/protocol/protocol.pyx":625
 *         assert self.waiter is None
 * 
 *         timeout = self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 * 
 *         # Ask the server to terminate the connection and wait for it
*/
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_timeout);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_timeout, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":629
 *         # Ask the server to terminate the connection and wait for it
 *         # to drop.
 *         self.waiter = self._new_waiter(timeout)             # <<<<<<<<<<<<<<
 *         self._terminate()
 *         try:
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->_new_waiter(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter);
  __pyx_cur_scope->__pyx_v_self->waiter = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":630
 *         # to drop.
 *         self.waiter = self._new_waiter(timeout)
 *         self._terminate()             # <<<<<<<<<<<<<<
 *         try:
 *             await self.waiter
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._terminate(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":631
 *         self.waiter = self._new_waiter(timeout)
 *         self._terminate()
 *         try:             # <<<<<<<<<<<<<<
 *             await self.waiter
 *         except ConnectionResetError:
*/
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":632
 *         self._terminate()
 *         try:
 *             await self.waiter             # <<<<<<<<<<<<<<
 *         except ConnectionResetError:
 *             # There appears to be a difference in behaviour of asyncio
*/
        __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->waiter, &__pyx_r);
        if (likely(__pyx_t_2 == PYGEN_NEXT)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_7);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
          __Pyx_XGIVEREF(__pyx_t_8);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 5;
          return __pyx_r;
          __pyx_L22_resume_from_await:;
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_8);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 632, __pyx_L16_error)
        } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
          __Pyx_GOTREF(__pyx_r);
          __Pyx_DECREF(__pyx_r); __pyx_r = 0;
        } else {
          __Pyx_XGOTREF(__pyx_r);
          __PYX_ERR(0, 632, __pyx_L16_error)
        }

        /* "asyncpg/protocol/protocol.pyx":631
 *         self.waiter = self._new_waiter(timeout)
 *         self._terminate()
 *         try:             # <<<<<<<<<<<<<<
 *             await self.waiter
 *         except ConnectionResetError:
*/
      }
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L21_try_end;
      __pyx_L16_error:;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "asyncpg/protocol/protocol.pyx":633
 *         try:
 *             await self.waiter
 *         except ConnectionResetError:             # <<<<<<<<<<<<<<
 *             # There appears to be a difference in behaviour of asyncio
 *             # in Windows, where, instead of calling protocol.connection_lost()
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ConnectionResetError))));
      if (__pyx_t_9) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L17_exception_handled;
      }
      goto __pyx_L18_except_error;

      /* "asyncpg/protocol/protocol.pyx":631
 *         self.waiter = self._new_waiter(timeout)
 *         self._terminate()
 *         try:             # <<<<<<<<<<<<<<
 *             await self.waiter
 *         except ConnectionResetError:
*/
      __pyx_L18_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L14_error;
      __pyx_L17_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      __pyx_L21_try_end:;
    }
  }

  /* "asyncpg/protocol/protocol.pyx":639
 *             pass
 *         finally:
 *             self.waiter = None             # <<<<<<<<<<<<<<
 *             self.transport.abort()
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter);
      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter);
      __pyx_cur_scope->__pyx_v_self->waiter = Py_None;

      /* "asyncpg/protocol/protocol.pyx":640
 *         finally:
 *             self.waiter = None
 *             self.transport.abort()             # <<<<<<<<<<<<<<
 * 
 *     def _request_cancel(self):
*/
      __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->__pyx_base.transport;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L15;
    }
    __pyx_L14_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_assign
      __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ( unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {

        /* "asyncpg/protocol/protocol.pyx":639
 *             pass
 *         finally:
 *             self.waiter = None             # <<<<<<<<<<<<<<
 *             self.transport.abort()
 * 
*/
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waiter);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->waiter);
        __pyx_cur_scope->__pyx_v_self->waiter = Py_None;

        /* "asyncpg/protocol/protocol.pyx":640
 *         finally:
 *             self.waiter = None
 *             self.transport.abort()             # <<<<<<<<<<<<<<
 * 
 *     def _request_cancel(self):
*/
        __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->__pyx_base.transport;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ErrRestore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L26_error:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L15:;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":602
 *         self.transport = None
 * 
 *     async def close(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":642
 *             self.transport.abort()
 * 
 *     def _request_cancel(self):             # <<<<<<<<<<<<<<
 *         self.cancel_waiter = self.create_future()
 *         self.cancel_sent_waiter = self.create_future()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel = {"_request_cancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_request_cancel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_request_cancel", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_request_cancel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_49_request_cancel(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_v_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_request_cancel", 0);

  /* "asyncpg/protocol/protocol.pyx":643
 * 
 *     def _request_cancel(self):
 *         self.cancel_waiter = self.create_future()             # <<<<<<<<<<<<<<
 *         self.cancel_sent_waiter = self.create_future()
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_v_self->create_future);
  __pyx_t_3 = __pyx_v_self->create_future; 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->cancel_waiter);
  __Pyx_DECREF(__pyx_v_self->cancel_waiter);
  __pyx_v_self->cancel_waiter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":644
 *     def _request_cancel(self):
 *         self.cancel_waiter = self.create_future()
 *         self.cancel_sent_waiter = self.create_future()             # <<<<<<<<<<<<<<
 * 
 *         con = self.get_connection()
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_v_self->create_future);
  __pyx_t_2 = __pyx_v_self->create_future; 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->cancel_sent_waiter);
  __Pyx_DECREF(__pyx_v_self->cancel_sent_waiter);
  __pyx_v_self->cancel_sent_waiter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":646
 *         self.cancel_sent_waiter = self.create_future()
 * 
 *         con = self.get_connection()             # <<<<<<<<<<<<<<
 *         if con is not None:
 *             # if 'con' is None it means that the connection object has been
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_con = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":647
 * 
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             # if 'con' is None it means that the connection object has been
 *             # garbage collected and that the transport will soon be aborted.
*/
  __pyx_t_5 = (__pyx_v_con != Py_None);
  if (__pyx_t_5) {

    /* "asyncpg/protocol/protocol.pyx":650
 *             # if 'con' is None it means that the connection object has been
 *             # garbage collected and that the transport will soon be aborted.
 *             con._cancel_current_command(self.cancel_sent_waiter)             # <<<<<<<<<<<<<<
 *         else:
 *             self.loop.call_exception_handler({
*/
    __pyx_t_2 = __pyx_v_con;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->cancel_sent_waiter};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel_current_command, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":647
 * 
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             # if 'con' is None it means that the connection object has been
 *             # garbage collected and that the transport will soon be aborted.
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":652
 *             con._cancel_current_command(self.cancel_sent_waiter)
 *         else:
 *             self.loop.call_exception_handler({             # <<<<<<<<<<<<<<
 *                 'message': 'asyncpg.Protocol has no reference to its '
 *                            'Connection object and yet a cancellation '
*/
  /*else*/ {
    __pyx_t_2 = __pyx_v_self->loop;
    __Pyx_INCREF(__pyx_t_2);

    /* "asyncpg/protocol/protocol.pyx":653
 *         else:
 *             self.loop.call_exception_handler({
 *                 'message': 'asyncpg.Protocol has no reference to its '             # <<<<<<<<<<<<<<
 *                            'Connection object and yet a cancellation '
 *                            'was requested. Please report this at '
*/
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_message, __pyx_mstate_global->__pyx_kp_u_asyncpg_Protocol_has_no_referenc) < (0)) __PYX_ERR(0, 653, __pyx_L1_error)
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_exception_handler, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":658
 *                            'github.com/magicstack/asyncpg.'
 *             })
 *             self.abort()             # <<<<<<<<<<<<<<
 * 
 *         if self.state == PROTOCOL_PREPARE:
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":660
 *             self.abort()
 * 
 *         if self.state == PROTOCOL_PREPARE:             # <<<<<<<<<<<<<<
 *             # we need to send a SYNC to server if we cancel during the PREPARE phase
 *             # because the PREPARE sequence does not send a SYNC itself.
*/
  __pyx_t_5 = (__pyx_v_self->__pyx_base.state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE);
  if (__pyx_t_5) {

    /* "asyncpg/protocol/protocol.pyx":666
 *             # because then we would issue two SYNCs and we would get two ReadyForQuery
 *             # replies, which our current state machine implementation cannot handle
 *             self._write(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_CANCELLED)
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._write(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/protocol.pyx":660
 *             self.abort()
 * 
 *         if self.state == PROTOCOL_PREPARE:             # <<<<<<<<<<<<<<
 *             # we need to send a SYNC to server if we cancel during the PREPARE phase
 *             # because the PREPARE sequence does not send a SYNC itself.
*/
  }

  /* "asyncpg/protocol/protocol.pyx":667
 *             # replies, which our current state machine implementation cannot handle
 *             self._write(SYNC_MESSAGE)
 *         self._set_state(PROTOCOL_CANCELLED)             # <<<<<<<<<<<<<<
 * 
 *     def _on_timeout(self, fut):
*/
  __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CANCELLED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":642
 *             self.transport.abort()
 * 
 *     def _request_cancel(self):             # <<<<<<<<<<<<<<
 *         self.cancel_waiter = self.create_future()
 *         self.cancel_sent_waiter = self.create_future()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._request_cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":669
 *         self._set_state(PROTOCOL_CANCELLED)
 * 
 *     def _on_timeout(self, fut):             # <<<<<<<<<<<<<<
 *         if self.waiter is not fut or fut.done() or \
 *                 self.cancel_waiter is not None or \
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout = {"_on_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fut = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_timeout (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fut,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 669, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_on_timeout", 0) < (0)) __PYX_ERR(0, 669, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_on_timeout", 1, 1, 1, i); __PYX_ERR(0, 669, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error)
    }
    __pyx_v_fut = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_on_timeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 669, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_fut);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_51_on_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_timeout", 0);

  /* "asyncpg/protocol/protocol.pyx":670
 * 
 *     def _on_timeout(self, fut):
 *         if self.waiter is not fut or fut.done() or \             # <<<<<<<<<<<<<<
 *                 self.cancel_waiter is not None or \
 *                 self.timeout_handle is None:
*/
  __pyx_t_2 = (__pyx_v_self->waiter != __pyx_v_fut);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __pyx_v_fut;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asyncpg/protocol/protocol.pyx":671
 *     def _on_timeout(self, fut):
 *         if self.waiter is not fut or fut.done() or \
 *                 self.cancel_waiter is not None or \             # <<<<<<<<<<<<<<
 *                 self.timeout_handle is None:
 *             return
*/
  __pyx_t_2 = (__pyx_v_self->cancel_waiter != Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asyncpg/protocol/protocol.pyx":672
 *         if self.waiter is not fut or fut.done() or \
 *                 self.cancel_waiter is not None or \
 *                 self.timeout_handle is None:             # <<<<<<<<<<<<<<
 *             return
 *         self._request_cancel()
*/
  __pyx_t_2 = (__pyx_v_self->timeout_handle == Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "asyncpg/protocol/protocol.pyx":670
 * 
 *     def _on_timeout(self, fut):
 *         if self.waiter is not fut or fut.done() or \             # <<<<<<<<<<<<<<
 *                 self.cancel_waiter is not None or \
 *                 self.timeout_handle is None:
*/
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":673
 *                 self.cancel_waiter is not None or \
 *                 self.timeout_handle is None:
 *             return             # <<<<<<<<<<<<<<
 *         self._request_cancel()
 *         self.waiter.set_exception(asyncio.TimeoutError())
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":670
 * 
 *     def _on_timeout(self, fut):
 *         if self.waiter is not fut or fut.done() or \             # <<<<<<<<<<<<<<
 *                 self.cancel_waiter is not None or \
 *                 self.timeout_handle is None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":674
 *                 self.timeout_handle is None:
 *             return
 *         self._request_cancel()             # <<<<<<<<<<<<<<
 *         self.waiter.set_exception(asyncio.TimeoutError())
 * 
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":675
 *             return
 *         self._request_cancel()
 *         self.waiter.set_exception(asyncio.TimeoutError())             # <<<<<<<<<<<<<<
 * 
 *     def _on_waiter_completed(self, fut):
*/
  __pyx_t_4 = __pyx_v_self->waiter;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_7);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":669
 *         self._set_state(PROTOCOL_CANCELLED)
 * 
 *     def _on_timeout(self, fut):             # <<<<<<<<<<<<<<
 *         if self.waiter is not fut or fut.done() or \
 *                 self.cancel_waiter is not None or \
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":677
 *         self.waiter.set_exception(asyncio.TimeoutError())
 * 
 *     def _on_waiter_completed(self, fut):             # <<<<<<<<<<<<<<
 *         if self.timeout_handle:
 *             self.timeout_handle.cancel()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed = {"_on_waiter_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_fut = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_on_waiter_completed (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fut,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 677, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_on_waiter_completed", 0) < (0)) __PYX_ERR(0, 677, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_on_waiter_completed", 1, 1, 1, i); __PYX_ERR(0, 677, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 677, __pyx_L3_error)
    }
    __pyx_v_fut = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_on_waiter_completed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 677, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_waiter_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_fut);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_53_on_waiter_completed(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_fut) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_waiter_completed", 0);

  /* "asyncpg/protocol/protocol.pyx":678
 * 
 *     def _on_waiter_completed(self, fut):
 *         if self.timeout_handle:             # <<<<<<<<<<<<<<
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->timeout_handle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 678, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":679
 *     def _on_waiter_completed(self, fut):
 *         if self.timeout_handle:
 *             self.timeout_handle.cancel()             # <<<<<<<<<<<<<<
 *             self.timeout_handle = None
 *         if fut is not self.waiter or self.cancel_waiter is not None:
*/
    __pyx_t_3 = __pyx_v_self->timeout_handle;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":680
 *         if self.timeout_handle:
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None             # <<<<<<<<<<<<<<
 *         if fut is not self.waiter or self.cancel_waiter is not None:
 *             return
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->timeout_handle);
    __Pyx_DECREF(__pyx_v_self->timeout_handle);
    __pyx_v_self->timeout_handle = Py_None;

    /* "asyncpg/protocol/protocol.pyx":678
 * 
 *     def _on_waiter_completed(self, fut):
 *         if self.timeout_handle:             # <<<<<<<<<<<<<<
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":681
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
 *         if fut is not self.waiter or self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             return
 *         if fut.cancelled():
*/
  __pyx_t_5 = (__pyx_v_fut != __pyx_v_self->waiter);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_self->cancel_waiter != Py_None);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":682
 *             self.timeout_handle = None
 *         if fut is not self.waiter or self.cancel_waiter is not None:
 *             return             # <<<<<<<<<<<<<<
 *         if fut.cancelled():
 *             self._request_cancel()
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":681
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
 *         if fut is not self.waiter or self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             return
 *         if fut.cancelled():
*/
  }

  /* "asyncpg/protocol/protocol.pyx":683
 *         if fut is not self.waiter or self.cancel_waiter is not None:
 *             return
 *         if fut.cancelled():             # <<<<<<<<<<<<<<
 *             self._request_cancel()
 * 
*/
  __pyx_t_3 = __pyx_v_fut;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancelled, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":684
 *             return
 *         if fut.cancelled():
 *             self._request_cancel()             # <<<<<<<<<<<<<<
 * 
 *     def _create_future_fallback(self):
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":683
 *         if fut is not self.waiter or self.cancel_waiter is not None:
 *             return
 *         if fut.cancelled():             # <<<<<<<<<<<<<<
 *             self._request_cancel()
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":677
 *         self.waiter.set_exception(asyncio.TimeoutError())
 * 
 *     def _on_waiter_completed(self, fut):             # <<<<<<<<<<<<<<
 *         if self.timeout_handle:
 *             self.timeout_handle.cancel()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_waiter_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":686
 *             self._request_cancel()
 * 
 *     def _create_future_fallback(self):             # <<<<<<<<<<<<<<
 *         return asyncio.Future(loop=self.loop)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback = {"_create_future_fallback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_future_fallback (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_create_future_fallback", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_create_future_fallback", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_55_create_future_fallback(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":687
 * 
 *     def _create_future_fallback(self):
 *         return asyncio.Future(loop=self.loop)             # <<<<<<<<<<<<<<
 * 
 *     cdef _handle_waiter_on_connection_lost(self, cause):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Future); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_loop, __pyx_v_self->loop, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 687, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":686
 *             self._request_cancel()
 * 
 *     def _create_future_fallback(self):             # <<<<<<<<<<<<<<
 *         return asyncio.Future(loop=self.loop)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._create_future_fallback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":689
 *         return asyncio.Future(loop=self.loop)
 * 
 *     cdef _handle_waiter_on_connection_lost(self, cause):             # <<<<<<<<<<<<<<
 *         if self.waiter is not None and not self.waiter.done():
 *             exc = apg_exc.ConnectionDoesNotExistError(
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_cause) {
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_handle_waiter_on_connection_lost", 0);

  /* "asyncpg/protocol/protocol.pyx":690
 * 
 *     cdef _handle_waiter_on_connection_lost(self, cause):
 *         if self.waiter is not None and not self.waiter.done():             # <<<<<<<<<<<<<<
 *             exc = apg_exc.ConnectionDoesNotExistError(
 *                 'connection was closed in the middle of '
*/
  __pyx_t_2 = (__pyx_v_self->waiter != Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __pyx_v_self->waiter;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (!__pyx_t_2);
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":691
 *     cdef _handle_waiter_on_connection_lost(self, cause):
 *         if self.waiter is not None and not self.waiter.done():
 *             exc = apg_exc.ConnectionDoesNotExistError(             # <<<<<<<<<<<<<<
 *                 'connection was closed in the middle of '
 *                 'operation')
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ConnectionDoesNotExistError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_connection_was_closed_in_the_mid};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_exc = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/protocol.pyx":694
 *                 'connection was closed in the middle of '
 *                 'operation')
 *             if cause is not None:             # <<<<<<<<<<<<<<
 *                 exc.__cause__ = cause
 *             self.waiter.set_exception(exc)
*/
    __pyx_t_1 = (__pyx_v_cause != Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/protocol.pyx":695
 *                 'operation')
 *             if cause is not None:
 *                 exc.__cause__ = cause             # <<<<<<<<<<<<<<
 *             self.waiter.set_exception(exc)
 *         self.waiter = None
*/
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_exc, __pyx_mstate_global->__pyx_n_u_cause, __pyx_v_cause) < (0)) __PYX_ERR(0, 695, __pyx_L1_error)

      /* "asyncpg/protocol/protocol.pyx":694
 *                 'connection was closed in the middle of '
 *                 'operation')
 *             if cause is not None:             # <<<<<<<<<<<<<<
 *                 exc.__cause__ = cause
 *             self.waiter.set_exception(exc)
*/
    }

    /* "asyncpg/protocol/protocol.pyx":696
 *             if cause is not None:
 *                 exc.__cause__ = cause
 *             self.waiter.set_exception(exc)             # <<<<<<<<<<<<<<
 *         self.waiter = None
 * 
*/
    __pyx_t_8 = __pyx_v_self->waiter;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_exc};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "asyncpg/protocol/protocol.pyx":690
 * 
 *     cdef _handle_waiter_on_connection_lost(self, cause):
 *         if self.waiter is not None and not self.waiter.done():             # <<<<<<<<<<<<<<
 *             exc = apg_exc.ConnectionDoesNotExistError(
 *                 'connection was closed in the middle of '
*/
  }

  /* "asyncpg/protocol/protocol.pyx":697
 *                 exc.__cause__ = cause
 *             self.waiter.set_exception(exc)
 *         self.waiter = None             # <<<<<<<<<<<<<<
 * 
 *     cdef _set_server_parameter(self, name, val):
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->waiter);
  __Pyx_DECREF(__pyx_v_self->waiter);
  __pyx_v_self->waiter = Py_None;

  /* "asyncpg/protocol/protocol.pyx":689
 *         return asyncio.Future(loop=self.loop)
 * 
 *     cdef _handle_waiter_on_connection_lost(self, cause):             # <<<<<<<<<<<<<<
 *         if self.waiter is not None and not self.waiter.done():
 *             exc = apg_exc.ConnectionDoesNotExistError(
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._handle_waiter_on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":699
 *         self.waiter = None
 * 
 *     cdef _set_server_parameter(self, name, val):             # <<<<<<<<<<<<<<
 *         self.settings.add_setting(name, val)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_server_parameter", 0);

  /* "asyncpg/protocol/protocol.pyx":700
 * 
 *     cdef _set_server_parameter(self, name, val):
 *         self.settings.add_setting(name, val)             # <<<<<<<<<<<<<<
 * 
 *     def _get_timeout(self, timeout):
*/
  __pyx_t_1 = __pyx_v_name;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 700, __pyx_L1_error)
  __pyx_t_2 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 700, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting(__pyx_v_self->settings, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "asyncpg/protocol/protocol.pyx":699
 *         self.waiter = None
 * 
 *     cdef _set_server_parameter(self, name, val):             # <<<<<<<<<<<<<<
 *         self.settings.add_setting(name, val)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._set_server_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":702
 *         self.settings.add_setting(name, val)
 * 
 *     def _get_timeout(self, timeout):             # <<<<<<<<<<<<<<
 *         if timeout is not None:
 *             try:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout = {"_get_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_timeout = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_timeout (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_timeout,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 702, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_timeout", 0) < (0)) __PYX_ERR(0, 702, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_timeout", 1, 1, 1, i); __PYX_ERR(0, 702, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error)
    }
    __pyx_v_timeout = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_timeout", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 702, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_timeout);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_57_get_timeout(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  size_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_timeout", 0);
  __Pyx_INCREF(__pyx_v_timeout);

  /* "asyncpg/protocol/protocol.pyx":703
 * 
 *     def _get_timeout(self, timeout):
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 if type(timeout) is bool:
*/
  __pyx_t_1 = (__pyx_v_timeout != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":704
 *     def _get_timeout(self, timeout):
 *         if timeout is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 if type(timeout) is bool:
 *                     raise ValueError
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":705
 *         if timeout is not None:
 *             try:
 *                 if type(timeout) is bool:             # <<<<<<<<<<<<<<
 *                     raise ValueError
 *                 timeout = float(timeout)
*/
        __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_timeout)) == ((PyObject *)(&PyBool_Type)));
        if (unlikely(__pyx_t_1)) {

          /* "asyncpg/protocol/protocol.pyx":706
 *             try:
 *                 if type(timeout) is bool:
 *                     raise ValueError             # <<<<<<<<<<<<<<
 *                 timeout = float(timeout)
 *             except ValueError:
*/
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), 0, 0, 0);
          __PYX_ERR(0, 706, __pyx_L4_error)

          /* "asyncpg/protocol/protocol.pyx":705
 *         if timeout is not None:
 *             try:
 *                 if type(timeout) is bool:             # <<<<<<<<<<<<<<
 *                     raise ValueError
 *                 timeout = float(timeout)
*/
        }

        /* "asyncpg/protocol/protocol.pyx":707
 *                 if type(timeout) is bool:
 *                     raise ValueError
 *                 timeout = float(timeout)             # <<<<<<<<<<<<<<
 *             except ValueError:
 *                 raise ValueError(
*/
        __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "asyncpg/protocol/protocol.pyx":704
 *     def _get_timeout(self, timeout):
 *         if timeout is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 if type(timeout) is bool:
 *                     raise ValueError
*/
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "asyncpg/protocol/protocol.pyx":708
 *                     raise ValueError
 *                 timeout = float(timeout)
 *             except ValueError:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'invalid timeout value: expected non-negative float '
*/
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
      if (__pyx_t_6) {
        __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 708, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);

        /* "asyncpg/protocol/protocol.pyx":709
 *                 timeout = float(timeout)
 *             except ValueError:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'invalid timeout value: expected non-negative float '
 *                     '(got {!r})'.format(timeout)) from None
*/
        __pyx_t_10 = NULL;

        /* "asyncpg/protocol/protocol.pyx":711
 *                 raise ValueError(
 *                     'invalid timeout value: expected non-negative float '
 *                     '(got {!r})'.format(timeout)) from None             # <<<<<<<<<<<<<<
 * 
 *         return self._get_timeout_impl(timeout)
*/
        __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_invalid_timeout_value_expected_n;
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_13 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_timeout};
          __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 711, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __pyx_t_13 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
          __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 709, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_Raise(__pyx_t_9, 0, 0, Py_None);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __PYX_ERR(0, 709, __pyx_L6_except_error)
      }
      goto __pyx_L6_except_error;

      /* "asyncpg/protocol/protocol.pyx":704
 *     def _get_timeout(self, timeout):
 *         if timeout is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 if type(timeout) is bool:
 *                     raise ValueError
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L9_try_end:;
    }

    /* "asyncpg/protocol/protocol.pyx":703
 * 
 *     def _get_timeout(self, timeout):
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 if type(timeout) is bool:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":713
 *                     '(got {!r})'.format(timeout)) from None
 * 
 *         return self._get_timeout_impl(timeout)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _get_timeout_impl(self, timeout):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(__pyx_v_self, __pyx_v_timeout); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":702
 *         self.settings.add_setting(name, val)
 * 
 *     def _get_timeout(self, timeout):             # <<<<<<<<<<<<<<
 *         if timeout is not None:
 *             try:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_timeout);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":715
 *         return self._get_timeout_impl(timeout)
 * 
 *     cdef inline _get_timeout_impl(self, timeout):             # <<<<<<<<<<<<<<
 *         if timeout is None:
 *             timeout = self.get_connection()._config.command_timeout
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_timeout_impl", 0);
  __Pyx_INCREF(__pyx_v_timeout);

  /* "asyncpg/protocol/protocol.pyx":716
 * 
 *     cdef inline _get_timeout_impl(self, timeout):
 *         if timeout is None:             # <<<<<<<<<<<<<<
 *             timeout = self.get_connection()._config.command_timeout
 *         elif timeout is NO_TIMEOUT:
*/
  __pyx_t_1 = (__pyx_v_timeout == Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":717
 *     cdef inline _get_timeout_impl(self, timeout):
 *         if timeout is None:
 *             timeout = self.get_connection()._config.command_timeout             # <<<<<<<<<<<<<<
 *         elif timeout is NO_TIMEOUT:
 *             timeout = None
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_command_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":716
 * 
 *     cdef inline _get_timeout_impl(self, timeout):
 *         if timeout is None:             # <<<<<<<<<<<<<<
 *             timeout = self.get_connection()._config.command_timeout
 *         elif timeout is NO_TIMEOUT:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":718
 *         if timeout is None:
 *             timeout = self.get_connection()._config.command_timeout
 *         elif timeout is NO_TIMEOUT:             # <<<<<<<<<<<<<<
 *             timeout = None
 *         else:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NO_TIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_v_timeout == __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":719
 *             timeout = self.get_connection()._config.command_timeout
 *         elif timeout is NO_TIMEOUT:
 *             timeout = None             # <<<<<<<<<<<<<<
 *         else:
 *             timeout = float(timeout)
*/
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF_SET(__pyx_v_timeout, Py_None);

    /* "asyncpg/protocol/protocol.pyx":718
 *         if timeout is None:
 *             timeout = self.get_connection()._config.command_timeout
 *         elif timeout is NO_TIMEOUT:             # <<<<<<<<<<<<<<
 *             timeout = None
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":721
 *             timeout = None
 *         else:
 *             timeout = float(timeout)             # <<<<<<<<<<<<<<
 * 
 *         if timeout is not None and timeout <= 0:
*/
  /*else*/ {
    __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":723
 *             timeout = float(timeout)
 * 
 *         if timeout is not None and timeout <= 0:             # <<<<<<<<<<<<<<
 *             raise asyncio.TimeoutError()
 *         return timeout
*/
  __pyx_t_4 = (__pyx_v_timeout != Py_None);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_timeout, __pyx_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/protocol.pyx":724
 * 
 *         if timeout is not None and timeout <= 0:
 *             raise asyncio.TimeoutError()             # <<<<<<<<<<<<<<
 *         return timeout
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TimeoutError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 724, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":723
 *             timeout = float(timeout)
 * 
 *         if timeout is not None and timeout <= 0:             # <<<<<<<<<<<<<<
 *             raise asyncio.TimeoutError()
 *         return timeout
*/
  }

  /* "asyncpg/protocol/protocol.pyx":725
 *         if timeout is not None and timeout <= 0:
 *             raise asyncio.TimeoutError()
 *         return timeout             # <<<<<<<<<<<<<<
 * 
 *     cdef _check_state(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_timeout);
  __pyx_r = __pyx_v_timeout;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":715
 *         return self._get_timeout_impl(timeout)
 * 
 *     cdef inline _get_timeout_impl(self, timeout):             # <<<<<<<<<<<<<<
 *         if timeout is None:
 *             timeout = self.get_connection()._config.command_timeout
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._get_timeout_impl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_timeout);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":727
 *         return timeout
 * 
 *     cdef _check_state(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             raise apg_exc.InterfaceError(
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_state", 0);

  /* "asyncpg/protocol/protocol.pyx":728
 * 
 *     cdef _check_state(self):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is cancelling')
*/
  __pyx_t_1 = (__pyx_v_self->cancel_waiter != Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/protocol.pyx":729
 *     cdef _check_state(self):
 *         if self.cancel_waiter is not None:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'cannot perform operation: another operation is cancelling')
 *         if self.closing:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 729, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":728
 * 
 *     cdef _check_state(self):
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is cancelling')
*/
  }

  /* "asyncpg/protocol/protocol.pyx":731
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is cancelling')
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: connection is closed')
*/
  if (unlikely(__pyx_v_self->closing)) {

    /* "asyncpg/protocol/protocol.pyx":732
 *                 'cannot perform operation: another operation is cancelling')
 *         if self.closing:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'cannot perform operation: connection is closed')
 *         if self.waiter is not None or self.timeout_handle is not None:
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_connect};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 732, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":731
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is cancelling')
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: connection is closed')
*/
  }

  /* "asyncpg/protocol/protocol.pyx":734
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: connection is closed')
 *         if self.waiter is not None or self.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is in progress')
*/
  __pyx_t_7 = (__pyx_v_self->waiter != Py_None);
  if (!__pyx_t_7) {
  } else {
    __pyx_t_1 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_self->timeout_handle != Py_None);
  __pyx_t_1 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/protocol.pyx":735
 *                 'cannot perform operation: connection is closed')
 *         if self.waiter is not None or self.timeout_handle is not None:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'cannot perform operation: another operation is in progress')
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another_2};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 735, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":734
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: connection is closed')
 *         if self.waiter is not None or self.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is in progress')
*/
  }

  /* "asyncpg/protocol/protocol.pyx":727
 *         return timeout
 * 
 *     cdef _check_state(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             raise apg_exc.InterfaceError(
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._check_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":738
 *                 'cannot perform operation: another operation is in progress')
 * 
 *     def _is_cancelling(self):             # <<<<<<<<<<<<<<
 *         return (
 *             self.cancel_waiter is not None or
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling = {"_is_cancelling", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_is_cancelling (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_is_cancelling", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_is_cancelling", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_59_is_cancelling(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":739
 * 
 *     def _is_cancelling(self):
 *         return (             # <<<<<<<<<<<<<<
 *             self.cancel_waiter is not None or
 *             self.cancel_sent_waiter is not None
*/
  __Pyx_XDECREF(__pyx_r);

  /* "asyncpg/protocol/protocol.pyx":740
 *     def _is_cancelling(self):
 *         return (
 *             self.cancel_waiter is not None or             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter is not None
 *         )
*/
  __pyx_t_2 = (__pyx_v_self->cancel_waiter != Py_None);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "asyncpg/protocol/protocol.pyx":741
 *         return (
 *             self.cancel_waiter is not None or
 *             self.cancel_sent_waiter is not None             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_2 = (__pyx_v_self->cancel_sent_waiter != Py_None);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":738
 *                 'cannot perform operation: another operation is in progress')
 * 
 *     def _is_cancelling(self):             # <<<<<<<<<<<<<<
 *         return (
 *             self.cancel_waiter is not None or
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._is_cancelling", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "asyncpg/protocol/protocol.pyx":744
 *         )
 * 
 *     async def _wait_for_cancellation(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation = {"_wait_for_cancellation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_wait_for_cancellation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_wait_for_cancellation", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_wait_for_cancellation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_61_wait_for_cancellation(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_wait_for_cancellation", 0);
  __pyx_cur_scope = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 744, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_wait_for_cancellation, __pyx_mstate_global->__pyx_n_u_BaseProtocol__wait_for_cancellat, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._wait_for_cancellation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7asyncpg_8protocol_8protocol_12BaseProtocol_63generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *__pyx_cur_scope = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_PySendResult __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_wait_for_cancellation", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 744, __pyx_L1_error)
  }

  /* "asyncpg/protocol/protocol.pyx":745
 * 
 *     async def _wait_for_cancellation(self):
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":746
 *     async def _wait_for_cancellation(self):
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter             # <<<<<<<<<<<<<<
 *             self.cancel_sent_waiter = None
 *         if self.cancel_waiter is not None:
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 746, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 746, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":747
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cancel_sent_waiter);
    __pyx_cur_scope->__pyx_v_self->cancel_sent_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":745
 * 
 *     async def _wait_for_cancellation(self):
 *         if self.cancel_sent_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":748
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 * 
*/
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":749
 *             self.cancel_sent_waiter = None
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter             # <<<<<<<<<<<<<<
 * 
 *     cdef _coreproto_error(self):
*/
    __pyx_t_2 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_cur_scope->__pyx_v_self->cancel_waiter, &__pyx_r);
    if (likely(__pyx_t_2 == PYGEN_NEXT)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L7_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 749, __pyx_L1_error)
    } else if (likely(__pyx_t_2 == PYGEN_RETURN)) {
      __Pyx_GOTREF(__pyx_r);
      __Pyx_DECREF(__pyx_r); __pyx_r = 0;
    } else {
      __Pyx_XGOTREF(__pyx_r);
      __PYX_ERR(0, 749, __pyx_L1_error)
    }

    /* "asyncpg/protocol/protocol.pyx":748
 *             await self.cancel_sent_waiter
 *             self.cancel_sent_waiter = None
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             await self.cancel_waiter
 * 
*/
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "asyncpg/protocol/protocol.pyx":744
 *         )
 * 
 *     async def _wait_for_cancellation(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("_wait_for_cancellation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":751
 *             await self.cancel_waiter
 * 
 *     cdef _coreproto_error(self):             # <<<<<<<<<<<<<<
 *         try:
 *             if self.waiter is not None:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_coreproto_error", 0);

  /* "asyncpg/protocol/protocol.pyx":752
 * 
 *     cdef _coreproto_error(self):
 *         try:             # <<<<<<<<<<<<<<
 *             if self.waiter is not None:
 *                 if not self.waiter.done():
*/
  /*try:*/ {

    /* "asyncpg/protocol/protocol.pyx":753
 *     cdef _coreproto_error(self):
 *         try:
 *             if self.waiter is not None:             # <<<<<<<<<<<<<<
 *                 if not self.waiter.done():
 *                     raise apg_exc.InternalClientError(
*/
    __pyx_t_1 = (__pyx_v_self->waiter != Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/protocol.pyx":754
 *         try:
 *             if self.waiter is not None:
 *                 if not self.waiter.done():             # <<<<<<<<<<<<<<
 *                     raise apg_exc.InternalClientError(
 *                         'waiter is not done while handling critical '
*/
      __pyx_t_3 = __pyx_v_self->waiter;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 754, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = (!__pyx_t_1);
      if (unlikely(__pyx_t_5)) {

        /* "asyncpg/protocol/protocol.pyx":755
 *             if self.waiter is not None:
 *                 if not self.waiter.done():
 *                     raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                         'waiter is not done while handling critical '
 *                         'protocol error')
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 755, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 755, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_4 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_4 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_waiter_is_not_done_while_handlin};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 755, __pyx_L4_error)

        /* "asyncpg/protocol/protocol.pyx":754
 *         try:
 *             if self.waiter is not None:
 *                 if not self.waiter.done():             # <<<<<<<<<<<<<<
 *                     raise apg_exc.InternalClientError(
 *                         'waiter is not done while handling critical '
*/
      }

      /* "asyncpg/protocol/protocol.pyx":758
 *                         'waiter is not done while handling critical '
 *                         'protocol error')
 *                 self.waiter = None             # <<<<<<<<<<<<<<
 *         finally:
 *             self.abort()
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->waiter);
      __Pyx_DECREF(__pyx_v_self->waiter);
      __pyx_v_self->waiter = Py_None;

      /* "asyncpg/protocol/protocol.pyx":753
 *     cdef _coreproto_error(self):
 *         try:
 *             if self.waiter is not None:             # <<<<<<<<<<<<<<
 *                 if not self.waiter.done():
 *                     raise apg_exc.InternalClientError(
*/
    }
  }

  /* "asyncpg/protocol/protocol.pyx":760
 *                 self.waiter = None
 *         finally:
 *             self.abort()             # <<<<<<<<<<<<<<
 * 
 *     cdef _new_waiter(self, timeout):
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_7 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ( unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
      {
        __pyx_t_7 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_4 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
      goto __pyx_L1_error;
      __pyx_L9_error:;
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "asyncpg/protocol/protocol.pyx":751
 *             await self.cancel_waiter
 * 
 *     cdef _coreproto_error(self):             # <<<<<<<<<<<<<<
 *         try:
 *             if self.waiter is not None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._coreproto_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":762
 *             self.abort()
 * 
 *     cdef _new_waiter(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.waiter is not None:
 *             raise apg_exc.InterfaceError(
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_new_waiter", 0);

  /* "asyncpg/protocol/protocol.pyx":763
 * 
 *     cdef _new_waiter(self, timeout):
 *         if self.waiter is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is in progress')
*/
  __pyx_t_1 = (__pyx_v_self->waiter != Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "asyncpg/protocol/protocol.pyx":764
 *     cdef _new_waiter(self, timeout):
 *         if self.waiter is not None:
 *             raise apg_exc.InterfaceError(             # <<<<<<<<<<<<<<
 *                 'cannot perform operation: another operation is in progress')
 *         self.waiter = self.create_future()
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InterfaceError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_cannot_perform_operation_another_2};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 764, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":763
 * 
 *     cdef _new_waiter(self, timeout):
 *         if self.waiter is not None:             # <<<<<<<<<<<<<<
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is in progress')
*/
  }

  /* "asyncpg/protocol/protocol.pyx":766
 *             raise apg_exc.InterfaceError(
 *                 'cannot perform operation: another operation is in progress')
 *         self.waiter = self.create_future()             # <<<<<<<<<<<<<<
 *         if timeout is not None:
 *             self.timeout_handle = self.loop.call_later(
*/
  __pyx_t_5 = NULL;
  __Pyx_INCREF(__pyx_v_self->create_future);
  __pyx_t_3 = __pyx_v_self->create_future; 
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->waiter);
  __Pyx_DECREF(__pyx_v_self->waiter);
  __pyx_v_self->waiter = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":767
 *                 'cannot perform operation: another operation is in progress')
 *         self.waiter = self.create_future()
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             self.timeout_handle = self.loop.call_later(
 *                 timeout, self._on_timeout, self.waiter)
*/
  __pyx_t_1 = (__pyx_v_timeout != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":768
 *         self.waiter = self.create_future()
 *         if timeout is not None:
 *             self.timeout_handle = self.loop.call_later(             # <<<<<<<<<<<<<<
 *                 timeout, self._on_timeout, self.waiter)
 *         self.waiter.add_done_callback(self._on_waiter_completed)
*/
    __pyx_t_3 = __pyx_v_self->loop;
    __Pyx_INCREF(__pyx_t_3);

    /* "asyncpg/protocol/protocol.pyx":769
 *         if timeout is not None:
 *             self.timeout_handle = self.loop.call_later(
 *                 timeout, self._on_timeout, self.waiter)             # <<<<<<<<<<<<<<
 *         self.waiter.add_done_callback(self._on_waiter_completed)
 *         return self.waiter
*/
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_timeout); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_5, __pyx_v_self->waiter};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_later, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }

    /* "asyncpg/protocol/protocol.pyx":768
 *         self.waiter = self.create_future()
 *         if timeout is not None:
 *             self.timeout_handle = self.loop.call_later(             # <<<<<<<<<<<<<<
 *                 timeout, self._on_timeout, self.waiter)
 *         self.waiter.add_done_callback(self._on_waiter_completed)
*/
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->timeout_handle);
    __Pyx_DECREF(__pyx_v_self->timeout_handle);
    __pyx_v_self->timeout_handle = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":767
 *                 'cannot perform operation: another operation is in progress')
 *         self.waiter = self.create_future()
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             self.timeout_handle = self.loop.call_later(
 *                 timeout, self._on_timeout, self.waiter)
*/
  }

  /* "asyncpg/protocol/protocol.pyx":770
 *             self.timeout_handle = self.loop.call_later(
 *                 timeout, self._on_timeout, self.waiter)
 *         self.waiter.add_done_callback(self._on_waiter_completed)             # <<<<<<<<<<<<<<
 *         return self.waiter
 * 
*/
  __pyx_t_5 = __pyx_v_self->waiter;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_waiter_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_add_done_callback, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":771
 *                 timeout, self._on_timeout, self.waiter)
 *         self.waiter.add_done_callback(self._on_waiter_completed)
 *         return self.waiter             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__connect(self, object waiter):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->waiter);
  __pyx_r = __pyx_v_self->waiter;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":762
 *             self.abort()
 * 
 *     cdef _new_waiter(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.waiter is not None:
 *             raise apg_exc.InterfaceError(
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._new_waiter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":773
 *         return self.waiter
 * 
 *     cdef _on_result__connect(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(True)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect(CYTHON_UNUSED struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__connect", 0);

  /* "asyncpg/protocol/protocol.pyx":774
 * 
 *     cdef _on_result__connect(self, object waiter):
 *         waiter.set_result(True)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__prepare(self, object waiter):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":773
 *         return self.waiter
 * 
 *     cdef _on_result__connect(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(True)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":776
 *         waiter.set_result(True)
 * 
 *     cdef _on_result__prepare(self, object waiter):             # <<<<<<<<<<<<<<
 *         if PG_DEBUG:
 *             if self.statement is None:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__prepare", 0);

  /* "asyncpg/protocol/protocol.pyx":777
 * 
 *     cdef _on_result__prepare(self, object waiter):
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(
*/
  __pyx_t_1 = (PG_DEBUG != 0);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":778
 *     cdef _on_result__prepare(self, object waiter):
 *         if PG_DEBUG:
 *             if self.statement is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_on_result__prepare: statement is None')
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_self->statement) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/protocol.pyx":779
 *         if PG_DEBUG:
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     '_on_result__prepare: statement is None')
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 779, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_on_result__prepare_statement_is};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 779, __pyx_L1_error)

      /* "asyncpg/protocol/protocol.pyx":778
 *     cdef _on_result__prepare(self, object waiter):
 *         if PG_DEBUG:
 *             if self.statement is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_on_result__prepare: statement is None')
*/
    }

    /* "asyncpg/protocol/protocol.pyx":777
 * 
 *     cdef _on_result__prepare(self, object waiter):
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(
*/
  }

  /* "asyncpg/protocol/protocol.pyx":782
 *                     '_on_result__prepare: statement is None')
 * 
 *         if self.result_param_desc is not None:             # <<<<<<<<<<<<<<
 *             self.statement._set_args_desc(self.result_param_desc)
 *         if self.result_row_desc is not None:
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":783
 * 
 *         if self.result_param_desc is not None:
 *             self.statement._set_args_desc(self.result_param_desc)             # <<<<<<<<<<<<<<
 *         if self.result_row_desc is not None:
 *             self.statement._set_row_desc(self.result_row_desc)
*/
    __pyx_t_2 = __pyx_v_self->__pyx_base.result_param_desc;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc(__pyx_v_self->statement, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/protocol.pyx":782
 *                     '_on_result__prepare: statement is None')
 * 
 *         if self.result_param_desc is not None:             # <<<<<<<<<<<<<<
 *             self.statement._set_args_desc(self.result_param_desc)
 *         if self.result_row_desc is not None:
*/
  }

  /* "asyncpg/protocol/protocol.pyx":784
 *         if self.result_param_desc is not None:
 *             self.statement._set_args_desc(self.result_param_desc)
 *         if self.result_row_desc is not None:             # <<<<<<<<<<<<<<
 *             self.statement._set_row_desc(self.result_row_desc)
 *         waiter.set_result(self.statement)
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.result_row_desc != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":785
 *             self.statement._set_args_desc(self.result_param_desc)
 *         if self.result_row_desc is not None:
 *             self.statement._set_row_desc(self.result_row_desc)             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.statement)
 * 
*/
    __pyx_t_5 = __pyx_v_self->__pyx_base.result_row_desc;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc(__pyx_v_self->statement, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":784
 *         if self.result_param_desc is not None:
 *             self.statement._set_args_desc(self.result_param_desc)
 *         if self.result_row_desc is not None:             # <<<<<<<<<<<<<<
 *             self.statement._set_row_desc(self.result_row_desc)
 *         waiter.set_result(self.statement)
*/
  }

  /* "asyncpg/protocol/protocol.pyx":786
 *         if self.result_row_desc is not None:
 *             self.statement._set_row_desc(self.result_row_desc)
 *         waiter.set_result(self.statement)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__bind_and_exec(self, object waiter):
*/
  __pyx_t_5 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->statement)};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":776
 *         waiter.set_result(True)
 * 
 *     cdef _on_result__prepare(self, object waiter):             # <<<<<<<<<<<<<<
 *         if PG_DEBUG:
 *             if self.statement is None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":788
 *         waiter.set_result(self.statement)
 * 
 *     cdef _on_result__bind_and_exec(self, object waiter):             # <<<<<<<<<<<<<<
 *         if self.return_extra:
 *             waiter.set_result((
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__bind_and_exec", 0);

  /* "asyncpg/protocol/protocol.pyx":789
 * 
 *     cdef _on_result__bind_and_exec(self, object waiter):
 *         if self.return_extra:             # <<<<<<<<<<<<<<
 *             waiter.set_result((
 *                 self.result,
*/
  if (__pyx_v_self->return_extra) {

    /* "asyncpg/protocol/protocol.pyx":790
 *     cdef _on_result__bind_and_exec(self, object waiter):
 *         if self.return_extra:
 *             waiter.set_result((             # <<<<<<<<<<<<<<
 *                 self.result,
 *                 self.result_status_msg,
*/
    __pyx_t_2 = __pyx_v_waiter;
    __Pyx_INCREF(__pyx_t_2);

    /* "asyncpg/protocol/protocol.pyx":793
 *                 self.result,
 *                 self.result_status_msg,
 *                 self.result_execute_completed))             # <<<<<<<<<<<<<<
 *         else:
 *             waiter.set_result(self.result)
*/
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "asyncpg/protocol/protocol.pyx":791
 *         if self.return_extra:
 *             waiter.set_result((
 *                 self.result,             # <<<<<<<<<<<<<<
 *                 self.result_status_msg,
 *                 self.result_execute_completed))
*/
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.result);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->__pyx_base.result) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->__pyx_base.result_status_msg) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 791, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":789
 * 
 *     cdef _on_result__bind_and_exec(self, object waiter):
 *         if self.return_extra:             # <<<<<<<<<<<<<<
 *             waiter.set_result((
 *                 self.result,
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":795
 *                 self.result_execute_completed))
 *         else:
 *             waiter.set_result(self.result)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__bind(self, object waiter):
*/
  /*else*/ {
    __pyx_t_4 = __pyx_v_waiter;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.result};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":788
 *         waiter.set_result(self.statement)
 * 
 *     cdef _on_result__bind_and_exec(self, object waiter):             # <<<<<<<<<<<<<<
 *         if self.return_extra:
 *             waiter.set_result((
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__bind_and_exec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":797
 *             waiter.set_result(self.result)
 * 
 *     cdef _on_result__bind(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__bind", 0);

  /* "asyncpg/protocol/protocol.pyx":798
 * 
 *     cdef _on_result__bind(self, object waiter):
 *         waiter.set_result(self.result)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__close_stmt_or_portal(self, object waiter):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.result};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":797
 *             waiter.set_result(self.result)
 * 
 *     cdef _on_result__bind(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__bind", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":800
 *         waiter.set_result(self.result)
 * 
 *     cdef _on_result__close_stmt_or_portal(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__close_stmt_or_portal", 0);

  /* "asyncpg/protocol/protocol.pyx":801
 * 
 *     cdef _on_result__close_stmt_or_portal(self, object waiter):
 *         waiter.set_result(self.result)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__simple_query(self, object waiter):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.result};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":800
 *         waiter.set_result(self.result)
 * 
 *     cdef _on_result__close_stmt_or_portal(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__close_stmt_or_portal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":803
 *         waiter.set_result(self.result)
 * 
 *     cdef _on_result__simple_query(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result_status_msg.decode(self.encoding))
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__simple_query", 0);

  /* "asyncpg/protocol/protocol.pyx":804
 * 
 *     cdef _on_result__simple_query(self, object waiter):
 *         waiter.set_result(self.result_status_msg.decode(self.encoding))             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__copy_out(self, object waiter):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __pyx_v_self->__pyx_base.result_status_msg;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self->__pyx_base.encoding};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":803
 *         waiter.set_result(self.result)
 * 
 *     cdef _on_result__simple_query(self, object waiter):             # <<<<<<<<<<<<<<
 *         waiter.set_result(self.result_status_msg.decode(self.encoding))
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":806
 *         waiter.set_result(self.result_status_msg.decode(self.encoding))
 * 
 *     cdef _on_result__copy_out(self, object waiter):             # <<<<<<<<<<<<<<
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE
 *         if copy_done:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  int __pyx_v_copy_done;
  PyObject *__pyx_v_status_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__copy_out", 0);

  /* "asyncpg/protocol/protocol.pyx":807
 * 
 *     cdef _on_result__copy_out(self, object waiter):
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE             # <<<<<<<<<<<<<<
 *         if copy_done:
 *             status_msg = self.result_status_msg.decode(self.encoding)
*/
  __pyx_v_copy_done = (__pyx_v_self->__pyx_base.state == __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE);

  /* "asyncpg/protocol/protocol.pyx":808
 *     cdef _on_result__copy_out(self, object waiter):
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE
 *         if copy_done:             # <<<<<<<<<<<<<<
 *             status_msg = self.result_status_msg.decode(self.encoding)
 *         else:
*/
  if (__pyx_v_copy_done) {

    /* "asyncpg/protocol/protocol.pyx":809
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE
 *         if copy_done:
 *             status_msg = self.result_status_msg.decode(self.encoding)             # <<<<<<<<<<<<<<
 *         else:
 *             status_msg = None
*/
    __pyx_t_2 = __pyx_v_self->__pyx_base.result_status_msg;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.encoding};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_v_status_msg = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":808
 *     cdef _on_result__copy_out(self, object waiter):
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE
 *         if copy_done:             # <<<<<<<<<<<<<<
 *             status_msg = self.result_status_msg.decode(self.encoding)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":811
 *             status_msg = self.result_status_msg.decode(self.encoding)
 *         else:
 *             status_msg = None             # <<<<<<<<<<<<<<
 * 
 *         # We need to put some backpressure on Postgres
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_status_msg = ((PyObject*)Py_None);
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":815
 *         # We need to put some backpressure on Postgres
 *         # here in case the sink is slow to process the output.
 *         self.pause_reading()             # <<<<<<<<<<<<<<
 * 
 *         waiter.set_result((self.result, copy_done, status_msg))
*/
  __pyx_t_1 = __pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":817
 *         self.pause_reading()
 * 
 *         waiter.set_result((self.result, copy_done, status_msg))             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result__copy_in(self, object waiter):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_copy_done); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.result);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.result) != (0)) __PYX_ERR(0, 817, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 817, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_status_msg);
  __Pyx_GIVEREF(__pyx_v_status_msg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_status_msg) != (0)) __PYX_ERR(0, 817, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":806
 *         waiter.set_result(self.result_status_msg.decode(self.encoding))
 * 
 *     cdef _on_result__copy_out(self, object waiter):             # <<<<<<<<<<<<<<
 *         cdef bint copy_done = self.state == PROTOCOL_COPY_OUT_DONE
 *         if copy_done:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__copy_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":819
 *         waiter.set_result((self.result, copy_done, status_msg))
 * 
 *     cdef _on_result__copy_in(self, object waiter):             # <<<<<<<<<<<<<<
 *         status_msg = self.result_status_msg.decode(self.encoding)
 *         waiter.set_result(status_msg)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_waiter) {
  PyObject *__pyx_v_status_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result__copy_in", 0);

  /* "asyncpg/protocol/protocol.pyx":820
 * 
 *     cdef _on_result__copy_in(self, object waiter):
 *         status_msg = self.result_status_msg.decode(self.encoding)             # <<<<<<<<<<<<<<
 *         waiter.set_result(status_msg)
 * 
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base.result_status_msg;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->__pyx_base.encoding};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_status_msg = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":821
 *     cdef _on_result__copy_in(self, object waiter):
 *         status_msg = self.result_status_msg.decode(self.encoding)
 *         waiter.set_result(status_msg)             # <<<<<<<<<<<<<<
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
*/
  __pyx_t_2 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_status_msg};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":819
 *         waiter.set_result((self.result, copy_done, status_msg))
 * 
 *     cdef _on_result__copy_in(self, object waiter):             # <<<<<<<<<<<<<<
 *         status_msg = self.result_status_msg.decode(self.encoding)
 *         waiter.set_result(status_msg)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result__copy_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_status_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":823
 *         waiter.set_result(status_msg)
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):             # <<<<<<<<<<<<<<
 *         if PG_DEBUG:
 *             if self.statement is None:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, char const *__pyx_v_buf, Py_ssize_t __pyx_v_buf_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_row", 0);

  /* "asyncpg/protocol/protocol.pyx":824
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(
*/
  __pyx_t_1 = (PG_DEBUG != 0);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":825
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
 *         if PG_DEBUG:
 *             if self.statement is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_decode_row: statement is None')
*/
    __pyx_t_1 = (((PyObject *)__pyx_v_self->statement) == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "asyncpg/protocol/protocol.pyx":826
 *         if PG_DEBUG:
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     '_decode_row: statement is None')
 * 
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_decode_row_statement_is_None};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 826, __pyx_L1_error)

      /* "asyncpg/protocol/protocol.pyx":825
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
 *         if PG_DEBUG:
 *             if self.statement is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError(
 *                     '_decode_row: statement is None')
*/
    }

    /* "asyncpg/protocol/protocol.pyx":824
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if self.statement is None:
 *                 raise apg_exc.InternalClientError(
*/
  }

  /* "asyncpg/protocol/protocol.pyx":829
 *                     '_decode_row: statement is None')
 * 
 *         return self.statement._decode_row(buf, buf_len)             # <<<<<<<<<<<<<<
 * 
 *     cdef _dispatch_result(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row(__pyx_v_self->statement, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":823
 *         waiter.set_result(status_msg)
 * 
 *     cdef _decode_row(self, const char* buf, ssize_t buf_len):             # <<<<<<<<<<<<<<
 *         if PG_DEBUG:
 *             if self.statement is None:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._decode_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":831
 *         return self.statement._decode_row(buf, buf_len)
 * 
 *     cdef _dispatch_result(self):             # <<<<<<<<<<<<<<
 *         waiter = self.waiter
 *         self.waiter = None
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_v_waiter = NULL;
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dispatch_result", 0);

  /* "asyncpg/protocol/protocol.pyx":832
 * 
 *     cdef _dispatch_result(self):
 *         waiter = self.waiter             # <<<<<<<<<<<<<<
 *         self.waiter = None
 * 
*/
  __pyx_t_1 = __pyx_v_self->waiter;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_waiter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":833
 *     cdef _dispatch_result(self):
 *         waiter = self.waiter
 *         self.waiter = None             # <<<<<<<<<<<<<<
 * 
 *         if PG_DEBUG:
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->waiter);
  __Pyx_DECREF(__pyx_v_self->waiter);
  __pyx_v_self->waiter = Py_None;

  /* "asyncpg/protocol/protocol.pyx":835
 *         self.waiter = None
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if waiter is None:
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
*/
  __pyx_t_2 = (PG_DEBUG != 0);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":836
 * 
 *         if PG_DEBUG:
 *             if waiter is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
 * 
*/
    __pyx_t_2 = (__pyx_v_waiter == Py_None);
    if (unlikely(__pyx_t_2)) {

      /* "asyncpg/protocol/protocol.pyx":837
 *         if PG_DEBUG:
 *             if waiter is None:
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')             # <<<<<<<<<<<<<<
 * 
 *         if waiter.cancelled():
*/
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_None};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 837, __pyx_L1_error)

      /* "asyncpg/protocol/protocol.pyx":836
 * 
 *         if PG_DEBUG:
 *             if waiter is None:             # <<<<<<<<<<<<<<
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
 * 
*/
    }

    /* "asyncpg/protocol/protocol.pyx":835
 *         self.waiter = None
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if waiter is None:
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
*/
  }

  /* "asyncpg/protocol/protocol.pyx":839
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
 * 
 *         if waiter.cancelled():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  __pyx_t_5 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancelled, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":840
 * 
 *         if waiter.cancelled():
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if waiter.done():
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":839
 *                 raise apg_exc.InternalClientError('_on_result: waiter is None')
 * 
 *         if waiter.cancelled():             # <<<<<<<<<<<<<<
 *             return
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":842
 *             return
 * 
 *         if waiter.done():             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('_on_result: waiter is done')
 * 
*/
  __pyx_t_5 = __pyx_v_waiter;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "asyncpg/protocol/protocol.pyx":843
 * 
 *         if waiter.done():
 *             raise apg_exc.InternalClientError('_on_result: waiter is done')             # <<<<<<<<<<<<<<
 * 
 *         if self.result_type == RESULT_FAILED:
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_on_result_waiter_is_done};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 843, __pyx_L1_error)

    /* "asyncpg/protocol/protocol.pyx":842
 *             return
 * 
 *         if waiter.done():             # <<<<<<<<<<<<<<
 *             raise apg_exc.InternalClientError('_on_result: waiter is done')
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":845
 *             raise apg_exc.InternalClientError('_on_result: waiter is done')
 * 
 *         if self.result_type == RESULT_FAILED:             # <<<<<<<<<<<<<<
 *             if isinstance(self.result, dict):
 *                 exc = apg_exc_base.PostgresError.new(
*/
  __pyx_t_2 = (__pyx_v_self->__pyx_base.result_type == __pyx_e_7asyncpg_8protocol_8protocol_RESULT_FAILED);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":846
 * 
 *         if self.result_type == RESULT_FAILED:
 *             if isinstance(self.result, dict):             # <<<<<<<<<<<<<<
 *                 exc = apg_exc_base.PostgresError.new(
 *                     self.result, query=self.last_query)
*/
    __pyx_t_1 = __pyx_v_self->__pyx_base.result;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = PyDict_Check(__pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "asyncpg/protocol/protocol.pyx":847
 *         if self.result_type == RESULT_FAILED:
 *             if isinstance(self.result, dict):
 *                 exc = apg_exc_base.PostgresError.new(             # <<<<<<<<<<<<<<
 *                     self.result, query=self.last_query)
 *             else:
*/
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PostgresError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_4);

      /* "asyncpg/protocol/protocol.pyx":848
 *             if isinstance(self.result, dict):
 *                 exc = apg_exc_base.PostgresError.new(
 *                     self.result, query=self.last_query)             # <<<<<<<<<<<<<<
 *             else:
 *                 exc = self.result
*/
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_v_self->__pyx_base.result};
        __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_query, __pyx_v_self->last_query, __pyx_t_5, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 847, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_exc = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "asyncpg/protocol/protocol.pyx":846
 * 
 *         if self.result_type == RESULT_FAILED:
 *             if isinstance(self.result, dict):             # <<<<<<<<<<<<<<
 *                 exc = apg_exc_base.PostgresError.new(
 *                     self.result, query=self.last_query)
*/
      goto __pyx_L8;
    }

    /* "asyncpg/protocol/protocol.pyx":850
 *                     self.result, query=self.last_query)
 *             else:
 *                 exc = self.result             # <<<<<<<<<<<<<<
 *             waiter.set_exception(exc)
 *             return
*/
    /*else*/ {
      __pyx_t_1 = __pyx_v_self->__pyx_base.result;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_exc = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L8:;

    /* "asyncpg/protocol/protocol.pyx":851
 *             else:
 *                 exc = self.result
 *             waiter.set_exception(exc)             # <<<<<<<<<<<<<<
 *             return
 * 
*/
    __pyx_t_3 = __pyx_v_waiter;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_exc};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":852
 *                 exc = self.result
 *             waiter.set_exception(exc)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":845
 *             raise apg_exc.InternalClientError('_on_result: waiter is done')
 * 
 *         if self.result_type == RESULT_FAILED:             # <<<<<<<<<<<<<<
 *             if isinstance(self.result, dict):
 *                 exc = apg_exc_base.PostgresError.new(
*/
  }

  /* "asyncpg/protocol/protocol.pyx":854
 *             return
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.state == PROTOCOL_AUTH:
 *                 self._on_result__connect(waiter)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "asyncpg/protocol/protocol.pyx":855
 * 
 *         try:
 *             if self.state == PROTOCOL_AUTH:             # <<<<<<<<<<<<<<
 *                 self._on_result__connect(waiter)
 * 
*/
      switch (__pyx_v_self->__pyx_base.state) {
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_AUTH:

        /* "asyncpg/protocol/protocol.pyx":856
 *         try:
 *             if self.state == PROTOCOL_AUTH:
 *                 self._on_result__connect(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_PREPARE:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__connect(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":855
 * 
 *         try:
 *             if self.state == PROTOCOL_AUTH:             # <<<<<<<<<<<<<<
 *                 self._on_result__connect(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_PREPARE:

        /* "asyncpg/protocol/protocol.pyx":859
 * 
 *             elif self.state == PROTOCOL_PREPARE:
 *                 self._on_result__prepare(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__prepare(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":858
 *                 self._on_result__connect(waiter)
 * 
 *             elif self.state == PROTOCOL_PREPARE:             # <<<<<<<<<<<<<<
 *                 self._on_result__prepare(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE:

        /* "asyncpg/protocol/protocol.pyx":862
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE:
 *                 self._on_result__bind_and_exec(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE_MANY:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":861
 *                 self._on_result__prepare(waiter)
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE:             # <<<<<<<<<<<<<<
 *                 self._on_result__bind_and_exec(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND_EXECUTE_MANY:

        /* "asyncpg/protocol/protocol.pyx":865
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE_MANY:
 *                 self._on_result__bind_and_exec(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_EXECUTE:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":864
 *                 self._on_result__bind_and_exec(waiter)
 * 
 *             elif self.state == PROTOCOL_BIND_EXECUTE_MANY:             # <<<<<<<<<<<<<<
 *                 self._on_result__bind_and_exec(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_EXECUTE:

        /* "asyncpg/protocol/protocol.pyx":868
 * 
 *             elif self.state == PROTOCOL_EXECUTE:
 *                 self._on_result__bind_and_exec(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_BIND:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind_and_exec(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":867
 *                 self._on_result__bind_and_exec(waiter)
 * 
 *             elif self.state == PROTOCOL_EXECUTE:             # <<<<<<<<<<<<<<
 *                 self._on_result__bind_and_exec(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_BIND:

        /* "asyncpg/protocol/protocol.pyx":871
 * 
 *             elif self.state == PROTOCOL_BIND:
 *                 self._on_result__bind(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_CLOSE_STMT_PORTAL:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__bind(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":870
 *                 self._on_result__bind_and_exec(waiter)
 * 
 *             elif self.state == PROTOCOL_BIND:             # <<<<<<<<<<<<<<
 *                 self._on_result__bind(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_CLOSE_STMT_PORTAL:

        /* "asyncpg/protocol/protocol.pyx":874
 * 
 *             elif self.state == PROTOCOL_CLOSE_STMT_PORTAL:
 *                 self._on_result__close_stmt_or_portal(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_SIMPLE_QUERY:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__close_stmt_or_portal(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":873
 *                 self._on_result__bind(waiter)
 * 
 *             elif self.state == PROTOCOL_CLOSE_STMT_PORTAL:             # <<<<<<<<<<<<<<
 *                 self._on_result__close_stmt_or_portal(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_SIMPLE_QUERY:

        /* "asyncpg/protocol/protocol.pyx":877
 * 
 *             elif self.state == PROTOCOL_SIMPLE_QUERY:
 *                 self._on_result__simple_query(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA or
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__simple_query(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":876
 *                 self._on_result__close_stmt_or_portal(waiter)
 * 
 *             elif self.state == PROTOCOL_SIMPLE_QUERY:             # <<<<<<<<<<<<<<
 *                 self._on_result__simple_query(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DATA:

        /* "asyncpg/protocol/protocol.pyx":879
 *                 self._on_result__simple_query(waiter)
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA or             # <<<<<<<<<<<<<<
 *                     self.state == PROTOCOL_COPY_OUT_DONE):
 *                 self._on_result__copy_out(waiter)
*/
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_OUT_DONE:

        /* "asyncpg/protocol/protocol.pyx":881
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA or
 *                     self.state == PROTOCOL_COPY_OUT_DONE):
 *                 self._on_result__copy_out(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_COPY_IN_DATA:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_out(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":879
 *                 self._on_result__simple_query(waiter)
 * 
 *             elif (self.state == PROTOCOL_COPY_OUT_DATA or             # <<<<<<<<<<<<<<
 *                     self.state == PROTOCOL_COPY_OUT_DONE):
 *                 self._on_result__copy_out(waiter)
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_COPY_IN_DATA:

        /* "asyncpg/protocol/protocol.pyx":884
 * 
 *             elif self.state == PROTOCOL_COPY_IN_DATA:
 *                 self._on_result__copy_in(waiter)             # <<<<<<<<<<<<<<
 * 
 *             elif self.state == PROTOCOL_TERMINATING:
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_result__copy_in(__pyx_v_self, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "asyncpg/protocol/protocol.pyx":883
 *                 self._on_result__copy_out(waiter)
 * 
 *             elif self.state == PROTOCOL_COPY_IN_DATA:             # <<<<<<<<<<<<<<
 *                 self._on_result__copy_in(waiter)
 * 
*/
        break;
        case __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_TERMINATING:

        /* "asyncpg/protocol/protocol.pyx":886
 *                 self._on_result__copy_in(waiter)
 * 
 *             elif self.state == PROTOCOL_TERMINATING:             # <<<<<<<<<<<<<<
 *                 # We are waiting for the connection to drop, so
 *                 # ignore any stray results at this point.
*/
        break;
        default:

        /* "asyncpg/protocol/protocol.pyx":892
 * 
 *             else:
 *                 raise apg_exc.InternalClientError(             # <<<<<<<<<<<<<<
 *                     'got result for unknown protocol state {}'.
 *                     format(self.state))
*/
        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_apg_exc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InternalClientError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "asyncpg/protocol/protocol.pyx":894
 *                 raise apg_exc.InternalClientError(
 *                     'got result for unknown protocol state {}'.
 *                     format(self.state))             # <<<<<<<<<<<<<<
 * 
 *         except Exception as exc:
*/
        __pyx_t_10 = __pyx_mstate_global->__pyx_kp_u_got_result_for_unknown_protocol;
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 894, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 892, __pyx_L9_error)
        break;
      }

      /* "asyncpg/protocol/protocol.pyx":854
 *             return
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.state == PROTOCOL_AUTH:
 *                 self._on_result__connect(waiter)
*/
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L14_try_end;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "asyncpg/protocol/protocol.pyx":896
 *                     format(self.state))
 * 
 *         except Exception as exc:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(exc)
 * 
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_12) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 896, __pyx_L11_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_exc = __pyx_t_4;
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":897
 * 
 *         except Exception as exc:
 *             waiter.set_exception(exc)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_result(self):
*/
        __pyx_t_11 = __pyx_v_waiter;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_exc};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }

      /* "asyncpg/protocol/protocol.pyx":896
 *                     format(self.state))
 * 
 *         except Exception as exc:             # <<<<<<<<<<<<<<
 *             waiter.set_exception(exc)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0;
          goto __pyx_L21;
        }
        __pyx_L20_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L11_except_error;
        }
        __pyx_L21:;
      }
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L10_exception_handled;
    }
    goto __pyx_L11_except_error;

    /* "asyncpg/protocol/protocol.pyx":854
 *             return
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.state == PROTOCOL_AUTH:
 *                 self._on_result__connect(waiter)
*/
    __pyx_L11_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L10_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    __pyx_L14_try_end:;
  }

  /* "asyncpg/protocol/protocol.pyx":831
 *         return self.statement._decode_row(buf, buf_len)
 * 
 *     cdef _dispatch_result(self):             # <<<<<<<<<<<<<<
 *         waiter = self.waiter
 *         self.waiter = None
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._dispatch_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_waiter);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":899
 *             waiter.set_exception(exc)
 * 
 *     cdef _on_result(self):             # <<<<<<<<<<<<<<
 *         if self.timeout_handle is not None:
 *             self.timeout_handle.cancel()
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  char const *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_result", 0);

  /* "asyncpg/protocol/protocol.pyx":900
 * 
 *     cdef _on_result(self):
 *         if self.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
*/
  __pyx_t_1 = (__pyx_v_self->timeout_handle != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":901
 *     cdef _on_result(self):
 *         if self.timeout_handle is not None:
 *             self.timeout_handle.cancel()             # <<<<<<<<<<<<<<
 *             self.timeout_handle = None
 * 
*/
    __pyx_t_3 = __pyx_v_self->timeout_handle;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cancel, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":902
 *         if self.timeout_handle is not None:
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->timeout_handle);
    __Pyx_DECREF(__pyx_v_self->timeout_handle);
    __pyx_v_self->timeout_handle = Py_None;

    /* "asyncpg/protocol/protocol.pyx":900
 * 
 *     cdef _on_result(self):
 *         if self.timeout_handle is not None:             # <<<<<<<<<<<<<<
 *             self.timeout_handle.cancel()
 *             self.timeout_handle = None
*/
  }

  /* "asyncpg/protocol/protocol.pyx":904
 *             self.timeout_handle = None
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             # We have received the result of a cancelled command.
 *             if not self.cancel_waiter.done():
*/
  __pyx_t_1 = (__pyx_v_self->cancel_waiter != Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":906
 *         if self.cancel_waiter is not None:
 *             # We have received the result of a cancelled command.
 *             if not self.cancel_waiter.done():             # <<<<<<<<<<<<<<
 *                 # The cancellation future might have been cancelled
 *                 # by the cancellation of the entire task running the query.
*/
    __pyx_t_3 = __pyx_v_self->cancel_waiter;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (!__pyx_t_1);
    if (__pyx_t_5) {

      /* "asyncpg/protocol/protocol.pyx":909
 *                 # The cancellation future might have been cancelled
 *                 # by the cancellation of the entire task running the query.
 *                 self.cancel_waiter.set_result(None)             # <<<<<<<<<<<<<<
 *             self.cancel_waiter = None
 *             if self.waiter is not None and self.waiter.done():
*/
      __pyx_t_3 = __pyx_v_self->cancel_waiter;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, Py_None};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/protocol.pyx":906
 *         if self.cancel_waiter is not None:
 *             # We have received the result of a cancelled command.
 *             if not self.cancel_waiter.done():             # <<<<<<<<<<<<<<
 *                 # The cancellation future might have been cancelled
 *                 # by the cancellation of the entire task running the query.
*/
    }

    /* "asyncpg/protocol/protocol.pyx":910
 *                 # by the cancellation of the entire task running the query.
 *                 self.cancel_waiter.set_result(None)
 *             self.cancel_waiter = None             # <<<<<<<<<<<<<<
 *             if self.waiter is not None and self.waiter.done():
 *                 self.waiter = None
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->cancel_waiter);
    __Pyx_DECREF(__pyx_v_self->cancel_waiter);
    __pyx_v_self->cancel_waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":911
 *                 self.cancel_waiter.set_result(None)
 *             self.cancel_waiter = None
 *             if self.waiter is not None and self.waiter.done():             # <<<<<<<<<<<<<<
 *                 self.waiter = None
 *             if self.waiter is None:
*/
    __pyx_t_1 = (__pyx_v_self->waiter != Py_None);
    if (__pyx_t_1) {
    } else {
      __pyx_t_5 = __pyx_t_1;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = __pyx_v_self->waiter;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 911, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_1;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_5) {

      /* "asyncpg/protocol/protocol.pyx":912
 *             self.cancel_waiter = None
 *             if self.waiter is not None and self.waiter.done():
 *                 self.waiter = None             # <<<<<<<<<<<<<<
 *             if self.waiter is None:
 *                 return
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->waiter);
      __Pyx_DECREF(__pyx_v_self->waiter);
      __pyx_v_self->waiter = Py_None;

      /* "asyncpg/protocol/protocol.pyx":911
 *                 self.cancel_waiter.set_result(None)
 *             self.cancel_waiter = None
 *             if self.waiter is not None and self.waiter.done():             # <<<<<<<<<<<<<<
 *                 self.waiter = None
 *             if self.waiter is None:
*/
    }

    /* "asyncpg/protocol/protocol.pyx":913
 *             if self.waiter is not None and self.waiter.done():
 *                 self.waiter = None
 *             if self.waiter is None:             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
    __pyx_t_5 = (__pyx_v_self->waiter == Py_None);
    if (__pyx_t_5) {

      /* "asyncpg/protocol/protocol.pyx":914
 *                 self.waiter = None
 *             if self.waiter is None:
 *                 return             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "asyncpg/protocol/protocol.pyx":913
 *             if self.waiter is not None and self.waiter.done():
 *                 self.waiter = None
 *             if self.waiter is None:             # <<<<<<<<<<<<<<
 *                 return
 * 
*/
    }

    /* "asyncpg/protocol/protocol.pyx":904
 *             self.timeout_handle = None
 * 
 *         if self.cancel_waiter is not None:             # <<<<<<<<<<<<<<
 *             # We have received the result of a cancelled command.
 *             if not self.cancel_waiter.done():
*/
  }

  /* "asyncpg/protocol/protocol.pyx":916
 *                 return
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self._dispatch_result()
 *         finally:
*/
  /*try:*/ {

    /* "asyncpg/protocol/protocol.pyx":917
 * 
 *         try:
 *             self._dispatch_result()             # <<<<<<<<<<<<<<
 *         finally:
 *             self.statement = None
*/
    __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_dispatch_result(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L11_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "asyncpg/protocol/protocol.pyx":919
 *             self._dispatch_result()
 *         finally:
 *             self.statement = None             # <<<<<<<<<<<<<<
 *             self.last_query = None
 *             self.return_extra = False
*/
  /*finally:*/ {
    /*normal exit:*/{
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->statement);
      __Pyx_DECREF((PyObject *)__pyx_v_self->statement);
      __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None);

      /* "asyncpg/protocol/protocol.pyx":920
 *         finally:
 *             self.statement = None
 *             self.last_query = None             # <<<<<<<<<<<<<<
 *             self.return_extra = False
 * 
*/
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->last_query);
      __Pyx_DECREF(__pyx_v_self->last_query);
      __pyx_v_self->last_query = ((PyObject*)Py_None);

      /* "asyncpg/protocol/protocol.pyx":921
 *             self.statement = None
 *             self.last_query = None
 *             self.return_extra = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_notice(self, parsed):
*/
      __pyx_v_self->return_extra = 0;
      goto __pyx_L12;
    }
    __pyx_L11_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ( unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
      {

        /* "asyncpg/protocol/protocol.pyx":919
 *             self._dispatch_result()
 *         finally:
 *             self.statement = None             # <<<<<<<<<<<<<<
 *             self.last_query = None
 *             self.return_extra = False
*/
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF((PyObject *)__pyx_v_self->statement);
        __Pyx_DECREF((PyObject *)__pyx_v_self->statement);
        __pyx_v_self->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None);

        /* "asyncpg/protocol/protocol.pyx":920
 *         finally:
 *             self.statement = None
 *             self.last_query = None             # <<<<<<<<<<<<<<
 *             self.return_extra = False
 * 
*/
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->last_query);
        __Pyx_DECREF(__pyx_v_self->last_query);
        __pyx_v_self->last_query = ((PyObject*)Py_None);

        /* "asyncpg/protocol/protocol.pyx":921
 *             self.statement = None
 *             self.last_query = None
 *             self.return_extra = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_notice(self, parsed):
*/
        __pyx_v_self->return_extra = 0;
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
      goto __pyx_L1_error;
    }
    __pyx_L12:;
  }

  /* "asyncpg/protocol/protocol.pyx":899
 *             waiter.set_exception(exc)
 * 
 *     cdef _on_result(self):             # <<<<<<<<<<<<<<
 *         if self.timeout_handle is not None:
 *             self.timeout_handle.cancel()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":923
 *             self.return_extra = False
 * 
 *     cdef _on_notice(self, parsed):             # <<<<<<<<<<<<<<
 *         con = self.get_connection()
 *         if con is not None:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_parsed) {
  PyObject *__pyx_v_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_notice", 0);

  /* "asyncpg/protocol/protocol.pyx":924
 * 
 *     cdef _on_notice(self, parsed):
 *         con = self.get_connection()             # <<<<<<<<<<<<<<
 *         if con is not None:
 *             con._process_log_message(parsed, self.last_query)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_con = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":925
 *     cdef _on_notice(self, parsed):
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             con._process_log_message(parsed, self.last_query)
 * 
*/
  __pyx_t_2 = (__pyx_v_con != Py_None);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":926
 *         con = self.get_connection()
 *         if con is not None:
 *             con._process_log_message(parsed, self.last_query)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_notification(self, pid, channel, payload):
*/
    __pyx_t_3 = __pyx_v_con;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_parsed, __pyx_v_self->last_query};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_process_log_message, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":925
 *     cdef _on_notice(self, parsed):
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             con._process_log_message(parsed, self.last_query)
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":923
 *             self.return_extra = False
 * 
 *     cdef _on_notice(self, parsed):             # <<<<<<<<<<<<<<
 *         con = self.get_connection()
 *         if con is not None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":928
 *             con._process_log_message(parsed, self.last_query)
 * 
 *     cdef _on_notification(self, pid, channel, payload):             # <<<<<<<<<<<<<<
 *         con = self.get_connection()
 *         if con is not None:
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_pid, PyObject *__pyx_v_channel, PyObject *__pyx_v_payload) {
  PyObject *__pyx_v_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_notification", 0);

  /* "asyncpg/protocol/protocol.pyx":929
 * 
 *     cdef _on_notification(self, pid, channel, payload):
 *         con = self.get_connection()             # <<<<<<<<<<<<<<
 *         if con is not None:
 *             con._process_notification(pid, channel, payload)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_con = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":930
 *     cdef _on_notification(self, pid, channel, payload):
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             con._process_notification(pid, channel, payload)
 * 
*/
  __pyx_t_2 = (__pyx_v_con != Py_None);
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":931
 *         con = self.get_connection()
 *         if con is not None:
 *             con._process_notification(pid, channel, payload)             # <<<<<<<<<<<<<<
 * 
 *     cdef _on_connection_lost(self, exc):
*/
    __pyx_t_3 = __pyx_v_con;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_pid, __pyx_v_channel, __pyx_v_payload};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_process_notification, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":930
 *     cdef _on_notification(self, pid, channel, payload):
 *         con = self.get_connection()
 *         if con is not None:             # <<<<<<<<<<<<<<
 *             con._process_notification(pid, channel, payload)
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":928
 *             con._process_log_message(parsed, self.last_query)
 * 
 *     cdef _on_notification(self, pid, channel, payload):             # <<<<<<<<<<<<<<
 *         con = self.get_connection()
 *         if con is not None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_notification", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":933
 *             con._process_notification(pid, channel, payload)
 * 
 *     cdef _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             # The connection was lost because
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc) {
  PyObject *__pyx_v_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_on_connection_lost", 0);

  /* "asyncpg/protocol/protocol.pyx":934
 * 
 *     cdef _on_connection_lost(self, exc):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             # The connection was lost because
 *             # Protocol.close() was called
*/
  if (__pyx_v_self->closing) {

    /* "asyncpg/protocol/protocol.pyx":937
 *             # The connection was lost because
 *             # Protocol.close() was called
 *             if self.waiter is not None and not self.waiter.done():             # <<<<<<<<<<<<<<
 *                 if exc is None:
 *                     self.waiter.set_result(None)
*/
    __pyx_t_2 = (__pyx_v_self->waiter != Py_None);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_4 = __pyx_v_self->waiter;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_done, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 937, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (!__pyx_t_2);
    __pyx_t_1 = __pyx_t_6;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "asyncpg/protocol/protocol.pyx":938
 *             # Protocol.close() was called
 *             if self.waiter is not None and not self.waiter.done():
 *                 if exc is None:             # <<<<<<<<<<<<<<
 *                     self.waiter.set_result(None)
 *                 else:
*/
      __pyx_t_1 = (__pyx_v_exc == Py_None);
      if (__pyx_t_1) {

        /* "asyncpg/protocol/protocol.pyx":939
 *             if self.waiter is not None and not self.waiter.done():
 *                 if exc is None:
 *                     self.waiter.set_result(None)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.waiter.set_exception(exc)
*/
        __pyx_t_4 = __pyx_v_self->waiter;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, Py_None};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_result, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "asyncpg/protocol/protocol.pyx":938
 *             # Protocol.close() was called
 *             if self.waiter is not None and not self.waiter.done():
 *                 if exc is None:             # <<<<<<<<<<<<<<
 *                     self.waiter.set_result(None)
 *                 else:
*/
        goto __pyx_L7;
      }

      /* "asyncpg/protocol/protocol.pyx":941
 *                     self.waiter.set_result(None)
 *                 else:
 *                     self.waiter.set_exception(exc)             # <<<<<<<<<<<<<<
 *             self.waiter = None
 *         else:
*/
      /*else*/ {
        __pyx_t_4 = __pyx_v_self->waiter;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_exc};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set_exception, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L7:;

      /* "asyncpg/protocol/protocol.pyx":937
 *             # The connection was lost because
 *             # Protocol.close() was called
 *             if self.waiter is not None and not self.waiter.done():             # <<<<<<<<<<<<<<
 *                 if exc is None:
 *                     self.waiter.set_result(None)
*/
    }

    /* "asyncpg/protocol/protocol.pyx":942
 *                 else:
 *                     self.waiter.set_exception(exc)
 *             self.waiter = None             # <<<<<<<<<<<<<<
 *         else:
 *             # The connection was lost because it was
*/
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->waiter);
    __Pyx_DECREF(__pyx_v_self->waiter);
    __pyx_v_self->waiter = Py_None;

    /* "asyncpg/protocol/protocol.pyx":934
 * 
 *     cdef _on_connection_lost(self, exc):
 *         if self.closing:             # <<<<<<<<<<<<<<
 *             # The connection was lost because
 *             # Protocol.close() was called
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":947
 *             # terminated or due to another error;
 *             # Throw an error in any awaiting waiter.
 *             self.closing = True             # <<<<<<<<<<<<<<
 *             # Cleanup the connection resources, including, possibly,
 *             # releasing the pool holder.
*/
  /*else*/ {
    __pyx_v_self->closing = 1;

    /* "asyncpg/protocol/protocol.pyx":950
 *             # Cleanup the connection resources, including, possibly,
 *             # releasing the pool holder.
 *             con = self.get_connection()             # <<<<<<<<<<<<<<
 *             if con is not None:
 *                 con._cleanup()
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->get_connection(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_con = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "asyncpg/protocol/protocol.pyx":951
 *             # releasing the pool holder.
 *             con = self.get_connection()
 *             if con is not None:             # <<<<<<<<<<<<<<
 *                 con._cleanup()
 *             self._handle_waiter_on_connection_lost(exc)
*/
    __pyx_t_1 = (__pyx_v_con != Py_None);
    if (__pyx_t_1) {

      /* "asyncpg/protocol/protocol.pyx":952
 *             con = self.get_connection()
 *             if con is not None:
 *                 con._cleanup()             # <<<<<<<<<<<<<<
 *             self._handle_waiter_on_connection_lost(exc)
 * 
*/
      __pyx_t_4 = __pyx_v_con;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cleanup, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 952, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "asyncpg/protocol/protocol.pyx":951
 *             # releasing the pool holder.
 *             con = self.get_connection()
 *             if con is not None:             # <<<<<<<<<<<<<<
 *                 con._cleanup()
 *             self._handle_waiter_on_connection_lost(exc)
*/
    }

    /* "asyncpg/protocol/protocol.pyx":953
 *             if con is not None:
 *                 con._cleanup()
 *             self._handle_waiter_on_connection_lost(exc)             # <<<<<<<<<<<<<<
 * 
 *     cdef _write(self, buf):
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_waiter_on_connection_lost(__pyx_v_self, __pyx_v_exc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":933
 *             con._process_notification(pid, channel, payload)
 * 
 *     cdef _on_connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             # The connection was lost because
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._on_connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":955
 *             self._handle_waiter_on_connection_lost(exc)
 * 
 *     cdef _write(self, buf):             # <<<<<<<<<<<<<<
 *         self.transport.write(memoryview(buf))
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_write", 0);

  /* "asyncpg/protocol/protocol.pyx":956
 * 
 *     cdef _write(self, buf):
 *         self.transport.write(memoryview(buf))             # <<<<<<<<<<<<<<
 * 
 *     cdef _writelines(self, list buffers):
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base.transport;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyMemoryView_FromObject(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":955
 *             self._handle_waiter_on_connection_lost(exc)
 * 
 *     cdef _write(self, buf):             # <<<<<<<<<<<<<<
 *         self.transport.write(memoryview(buf))
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":958
 *         self.transport.write(memoryview(buf))
 * 
 *     cdef _writelines(self, list buffers):             # <<<<<<<<<<<<<<
 *         self.transport.writelines(buffers)
 * 
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_buffers) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_writelines", 0);

  /* "asyncpg/protocol/protocol.pyx":959
 * 
 *     cdef _writelines(self, list buffers):
 *         self.transport.writelines(buffers)             # <<<<<<<<<<<<<<
 * 
 *     # asyncio callbacks:
*/
  __pyx_t_2 = __pyx_v_self->__pyx_base.transport;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_buffers};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writelines, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":958
 *         self.transport.write(memoryview(buf))
 * 
 *     cdef _writelines(self, list buffers):             # <<<<<<<<<<<<<<
 *         self.transport.writelines(buffers)
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol._writelines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":963
 *     # asyncio callbacks:
 * 
 *     def data_received(self, data):             # <<<<<<<<<<<<<<
 *         self.buffer.feed_data(data)
 *         self._read_server_messages()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received = {"data_received", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_data = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("data_received (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 963, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 963, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "data_received", 0) < (0)) __PYX_ERR(0, 963, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("data_received", 1, 1, 1, i); __PYX_ERR(0, 963, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 963, __pyx_L3_error)
    }
    __pyx_v_data = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("data_received", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 963, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_data);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_64data_received(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("data_received", 0);

  /* "asyncpg/protocol/protocol.pyx":964
 * 
 *     def data_received(self, data):
 *         self.buffer.feed_data(data)             # <<<<<<<<<<<<<<
 *         self._read_server_messages()
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->feed_data(__pyx_v_self->__pyx_base.buffer, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":965
 *     def data_received(self, data):
 *         self.buffer.feed_data(data)
 *         self._read_server_messages()             # <<<<<<<<<<<<<<
 * 
 *     def connection_made(self, transport):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._read_server_messages(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":963
 *     # asyncio callbacks:
 * 
 *     def data_received(self, data):             # <<<<<<<<<<<<<<
 *         self.buffer.feed_data(data)
 *         self._read_server_messages()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":967
 *         self._read_server_messages()
 * 
 *     def connection_made(self, transport):             # <<<<<<<<<<<<<<
 *         self.transport = transport
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made = {"connection_made", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_transport = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connection_made (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_transport,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 967, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "connection_made", 0) < (0)) __PYX_ERR(0, 967, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("connection_made", 1, 1, 1, i); __PYX_ERR(0, 967, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 967, __pyx_L3_error)
    }
    __pyx_v_transport = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connection_made", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 967, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_transport);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_66connection_made(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_transport) {
  PyObject *__pyx_v_sock = NULL;
  PyObject *__pyx_v_ex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connection_made", 0);

  /* "asyncpg/protocol/protocol.pyx":968
 * 
 *     def connection_made(self, transport):
 *         self.transport = transport             # <<<<<<<<<<<<<<
 * 
 *         sock = transport.get_extra_info('socket')
*/
  __Pyx_INCREF(__pyx_v_transport);
  __Pyx_GIVEREF(__pyx_v_transport);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.transport);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.transport);
  __pyx_v_self->__pyx_base.transport = __pyx_v_transport;

  /* "asyncpg/protocol/protocol.pyx":970
 *         self.transport = transport
 * 
 *         sock = transport.get_extra_info('socket')             # <<<<<<<<<<<<<<
 *         if (sock is not None and
 *               (not hasattr(socket, 'AF_UNIX')
*/
  __pyx_t_2 = __pyx_v_transport;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_extra_info, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_sock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":971
 * 
 *         sock = transport.get_extra_info('socket')
 *         if (sock is not None and             # <<<<<<<<<<<<<<
 *               (not hasattr(socket, 'AF_UNIX')
 *                or sock.family != socket.AF_UNIX)):
*/
  __pyx_t_5 = (__pyx_v_sock != Py_None);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asyncpg/protocol/protocol.pyx":972
 *         sock = transport.get_extra_info('socket')
 *         if (sock is not None and
 *               (not hasattr(socket, 'AF_UNIX')             # <<<<<<<<<<<<<<
 *                or sock.family != socket.AF_UNIX)):
 *             sock.setsockopt(socket.IPPROTO_TCP,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_HasAttr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AF_UNIX); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (!__pyx_t_5);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }

  /* "asyncpg/protocol/protocol.pyx":973
 *         if (sock is not None and
 *               (not hasattr(socket, 'AF_UNIX')
 *                or sock.family != socket.AF_UNIX)):             # <<<<<<<<<<<<<<
 *             sock.setsockopt(socket.IPPROTO_TCP,
 *                             socket.TCP_NODELAY, 1)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sock, __pyx_mstate_global->__pyx_n_u_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AF_UNIX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;

  /* "asyncpg/protocol/protocol.pyx":971
 * 
 *         sock = transport.get_extra_info('socket')
 *         if (sock is not None and             # <<<<<<<<<<<<<<
 *               (not hasattr(socket, 'AF_UNIX')
 *                or sock.family != socket.AF_UNIX)):
*/
  if (__pyx_t_4) {

    /* "asyncpg/protocol/protocol.pyx":974
 *               (not hasattr(socket, 'AF_UNIX')
 *                or sock.family != socket.AF_UNIX)):
 *             sock.setsockopt(socket.IPPROTO_TCP,             # <<<<<<<<<<<<<<
 *                             socket.TCP_NODELAY, 1)
 * 
*/
    __pyx_t_7 = __pyx_v_sock;
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_IPPROTO_TCP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":975
 *                or sock.family != socket.AF_UNIX)):
 *             sock.setsockopt(socket.IPPROTO_TCP,
 *                             socket.TCP_NODELAY, 1)             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_TCP_NODELAY); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_mstate_global->__pyx_int_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setsockopt, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":971
 * 
 *         sock = transport.get_extra_info('socket')
 *         if (sock is not None and             # <<<<<<<<<<<<<<
 *               (not hasattr(socket, 'AF_UNIX')
 *                or sock.family != socket.AF_UNIX)):
*/
  }

  /* "asyncpg/protocol/protocol.pyx":977
 *                             socket.TCP_NODELAY, 1)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self._connect()
 *         except Exception as ex:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_12);
    /*try:*/ {

      /* "asyncpg/protocol/protocol.pyx":978
 * 
 *         try:
 *             self._connect()             # <<<<<<<<<<<<<<
 *         except Exception as ex:
 *             transport.abort()
*/
      __pyx_t_2 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._connect(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "asyncpg/protocol/protocol.pyx":977
 *                             socket.TCP_NODELAY, 1)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self._connect()
 *         except Exception as ex:
*/
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L12_try_end;
    __pyx_L7_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "asyncpg/protocol/protocol.pyx":979
 *         try:
 *             self._connect()
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             transport.abort()
 *             self.con_status = CONNECTION_BAD
*/
    __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_13) {
      __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 979, __pyx_L9_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_v_ex = __pyx_t_9;
      /*try:*/ {

        /* "asyncpg/protocol/protocol.pyx":980
 *             self._connect()
 *         except Exception as ex:
 *             transport.abort()             # <<<<<<<<<<<<<<
 *             self.con_status = CONNECTION_BAD
 *             self._set_state(PROTOCOL_FAILED)
*/
        __pyx_t_1 = __pyx_v_transport;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_abort, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":981
 *         except Exception as ex:
 *             transport.abort()
 *             self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *             self._set_state(PROTOCOL_FAILED)
 *             self._on_error(ex)
*/
        __pyx_v_self->__pyx_base.con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

        /* "asyncpg/protocol/protocol.pyx":982
 *             transport.abort()
 *             self.con_status = CONNECTION_BAD
 *             self._set_state(PROTOCOL_FAILED)             # <<<<<<<<<<<<<<
 *             self._on_error(ex)
 * 
*/
        __pyx_t_7 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 982, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "asyncpg/protocol/protocol.pyx":983
 *             self.con_status = CONNECTION_BAD
 *             self._set_state(PROTOCOL_FAILED)
 *             self._on_error(ex)             # <<<<<<<<<<<<<<
 * 
 *     def connection_lost(self, exc):
*/
        __pyx_t_1 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_ex};
          __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_on_error, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }

      /* "asyncpg/protocol/protocol.pyx":979
 *         try:
 *             self._connect()
 *         except Exception as ex:             # <<<<<<<<<<<<<<
 *             transport.abort()
 *             self.con_status = CONNECTION_BAD
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
          goto __pyx_L19;
        }
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L9_except_error;
        }
        __pyx_L19:;
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L8_exception_handled;
    }
    goto __pyx_L9_except_error;

    /* "asyncpg/protocol/protocol.pyx":977
 *                             socket.TCP_NODELAY, 1)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             self._connect()
 *         except Exception as ex:
*/
    __pyx_L9_except_error:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    goto __pyx_L1_error;
    __pyx_L8_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    __pyx_L12_try_end:;
  }

  /* "asyncpg/protocol/protocol.pyx":967
 *         self._read_server_messages()
 * 
 *     def connection_made(self, transport):             # <<<<<<<<<<<<<<
 *         self.transport = transport
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_made", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sock);
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":985
 *             self._on_error(ex)
 * 
 *     def connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         self.con_status = CONNECTION_BAD
 *         self._set_state(PROTOCOL_FAILED)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost = {"connection_lost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_exc = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connection_lost (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_exc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 985, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 985, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "connection_lost", 0) < (0)) __PYX_ERR(0, 985, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("connection_lost", 1, 1, 1, i); __PYX_ERR(0, 985, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 985, __pyx_L3_error)
    }
    __pyx_v_exc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connection_lost", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 985, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v_exc);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_68connection_lost(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_exc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connection_lost", 0);

  /* "asyncpg/protocol/protocol.pyx":986
 * 
 *     def connection_lost(self, exc):
 *         self.con_status = CONNECTION_BAD             # <<<<<<<<<<<<<<
 *         self._set_state(PROTOCOL_FAILED)
 *         self._on_connection_lost(exc)
*/
  __pyx_v_self->__pyx_base.con_status = __pyx_e_7asyncpg_8protocol_8protocol_CONNECTION_BAD;

  /* "asyncpg/protocol/protocol.pyx":987
 *     def connection_lost(self, exc):
 *         self.con_status = CONNECTION_BAD
 *         self._set_state(PROTOCOL_FAILED)             # <<<<<<<<<<<<<<
 *         self._on_connection_lost(exc)
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_e_7asyncpg_8protocol_8protocol_PROTOCOL_FAILED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":988
 *         self.con_status = CONNECTION_BAD
 *         self._set_state(PROTOCOL_FAILED)
 *         self._on_connection_lost(exc)             # <<<<<<<<<<<<<<
 * 
 *     def pause_writing(self):
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._on_connection_lost(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v_self), __pyx_v_exc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":985
 *             self._on_error(ex)
 * 
 *     def connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         self.con_status = CONNECTION_BAD
 *         self._set_state(PROTOCOL_FAILED)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.connection_lost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":990
 *         self._on_connection_lost(exc)
 * 
 *     def pause_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.clear()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing = {"pause_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pause_writing (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("pause_writing", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pause_writing", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_70pause_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pause_writing", 0);

  /* "asyncpg/protocol/protocol.pyx":991
 * 
 *     def pause_writing(self):
 *         self.writing_allowed.clear()             # <<<<<<<<<<<<<<
 * 
 *     def resume_writing(self):
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":990
 *         self._on_connection_lost(exc)
 * 
 *     def pause_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.clear()
 * 
*/

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

/* "asyncpg/protocol/protocol.pyx":993
 *         self.writing_allowed.clear()
 * 
 *     def resume_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.set()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing = {"resume_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resume_writing (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("resume_writing", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("resume_writing", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_72resume_writing(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("resume_writing", 0);

  /* "asyncpg/protocol/protocol.pyx":994
 * 
 *     def resume_writing(self):
 *         self.writing_allowed.set()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_writing_allowed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_set, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "asyncpg/protocol/protocol.pyx":993
 *         self.writing_allowed.clear()
 * 
 *     def resume_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.set()
 * 
*/

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

/* "asyncpg/protocol/protocol.pyx":996
 *         self.writing_allowed.set()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_ssl(self):
 *         return self._is_ssl
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

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

  /* "asyncpg/protocol/protocol.pyx":998
 *     @property
 *     def is_ssl(self):
 *         return self._is_ssl             # <<<<<<<<<<<<<<
 * 
 *     @is_ssl.setter
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_ssl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":996
 *         self.writing_allowed.set()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def is_ssl(self):
 *         return self._is_ssl
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_ssl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1000
 *         return self._is_ssl
 * 
 *     @is_ssl.setter             # <<<<<<<<<<<<<<
 *     def is_ssl(self, value):
 *         self._is_ssl = value
*/

/* Python wrapper */
static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_2__set__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "asyncpg/protocol/protocol.pyx":1002
 *     @is_ssl.setter
 *     def is_ssl(self, value):
 *         self._is_ssl = value             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
  __pyx_v_self->_is_ssl = __pyx_t_1;

  /* "asyncpg/protocol/protocol.pyx":1000
 *         return self._is_ssl
 * 
 *     @is_ssl.setter             # <<<<<<<<<<<<<<
 *     def is_ssl(self, value):
 *         self._is_ssl = value
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.is_ssl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pxd":50
 *         bint closing
 * 
 *         readonly uint64_t queries_count             # <<<<<<<<<<<<<<
 * 
 *         bint _is_ssl
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count___get__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.queries_count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_74__reduce_cython__(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._discard_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_is_ssl); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base._skip_discard); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_pid); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int32_t(__pyx_v_self->__pyx_base.backend_secret); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->closing); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_v_self->__pyx_base.con_status); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_self->is_reading); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->queries_count); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.result_execute_completed); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_v_self->__pyx_base.result_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_v_self->return_extra); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_v_self->__pyx_base.state); if (unlikely(!__pyx_t_13)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyBool_FromLong(__pyx_v_self->writing_paused); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_v_self->__pyx_base.xact_status); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = PyTuple_New(40); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_iter);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_iter);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_self->__pyx_base._execute_iter) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_portal_name);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_portal_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_self->__pyx_base._execute_portal_name) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base._execute_stmt_name);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base._execute_stmt_name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_v_self->__pyx_base._execute_stmt_name) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_2) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_3) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.address);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.address);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_v_self->__pyx_base.address) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_4) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_5) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.buffer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.buffer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 9, ((PyObject *)__pyx_v_self->__pyx_base.buffer)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->cancel_sent_waiter);
  __Pyx_GIVEREF(__pyx_v_self->cancel_sent_waiter);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_v_self->cancel_sent_waiter) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->cancel_waiter);
  __Pyx_GIVEREF(__pyx_v_self->cancel_waiter);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_v_self->cancel_waiter) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 12, __pyx_t_6) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.con_params);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.con_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 13, __pyx_v_self->__pyx_base.con_params) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 14, __pyx_t_7) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->conref);
  __Pyx_GIVEREF(__pyx_v_self->conref);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 15, __pyx_v_self->conref) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->create_future);
  __Pyx_GIVEREF(__pyx_v_self->create_future);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 16, __pyx_v_self->create_future) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 17, __pyx_v_self->__pyx_base.encoding) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.gss_ctx);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.gss_ctx);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 18, __pyx_v_self->__pyx_base.gss_ctx) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 19, __pyx_t_8) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->last_query);
  __Pyx_GIVEREF(__pyx_v_self->last_query);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 20, __pyx_v_self->last_query) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->loop);
  __Pyx_GIVEREF(__pyx_v_self->loop);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 21, __pyx_v_self->loop) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 22, __pyx_t_9) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->record_class);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->record_class);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 23, ((PyObject *)__pyx_v_self->record_class)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.result);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 24, __pyx_v_self->__pyx_base.result) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 25, __pyx_t_10) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.result_param_desc);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_param_desc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 26, __pyx_v_self->__pyx_base.result_param_desc) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.result_row_desc);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_row_desc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 27, __pyx_v_self->__pyx_base.result_row_desc) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.result_status_msg);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.result_status_msg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 28, __pyx_v_self->__pyx_base.result_status_msg) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 29, __pyx_t_11) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_12);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 30, __pyx_t_12) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.scram);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.scram);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 31, ((PyObject *)__pyx_v_self->__pyx_base.scram)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->settings);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->settings);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 32, ((PyObject *)__pyx_v_self->settings)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_13);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 33, __pyx_t_13) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->statement);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->statement);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 34, ((PyObject *)__pyx_v_self->statement)) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->timeout_handle);
  __Pyx_GIVEREF(__pyx_v_self->timeout_handle);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 35, __pyx_v_self->timeout_handle) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.transport);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.transport);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 36, __pyx_v_self->__pyx_base.transport) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->waiter);
  __Pyx_GIVEREF(__pyx_v_self->waiter);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 37, __pyx_v_self->waiter) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_14);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 38, __pyx_t_14) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_15);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 39, __pyx_t_15) != (0)) __PYX_ERR(9, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_16);
  __pyx_t_16 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_16 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_v__dict = __pyx_t_16;
  __pyx_t_16 = 0;

  /* "(tree fragment)":7
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_18 = (__pyx_v__dict != Py_None);
  if (__pyx_t_18) {
  } else {
    __pyx_t_17 = __pyx_t_18;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(9, 7, __pyx_L1_error)
  __pyx_t_17 = __pyx_t_18;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_17) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v__dict) != (0)) __PYX_ERR(9, 8, __pyx_L1_error);
    __pyx_t_15 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_15));
    __pyx_t_15 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._discard_data, self._execute_iter, self._execute_portal_name, self._execute_stmt_name, self._is_ssl, self._skip_discard, self.address, self.backend_pid, self.backend_secret, self.buffer, self.cancel_sent_waiter, self.cancel_waiter, self.closing, self.con_params, self.con_status, self.conref, self.create_future, self.encoding, self.gss_ctx, self.is_reading, self.last_query, self.loop, self.queries_count, self.record_class, self.result, self.result_execute_completed, self.result_param_desc, self.result_row_desc, self.result_status_msg, self.result_type, self.return_extra, self.scram, self.settings, self.state, self.statement, self.timeout_handle, self.transport, self.waiter, self.writing_paused, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state
*/
  /*else*/ {
    __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_iter != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_portal_name != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base._execute_stmt_name != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.address != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (((PyObject *)__pyx_v_self->__pyx_base.buffer) != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->cancel_sent_waiter != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->cancel_waiter != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.con_params != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->conref != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->create_future != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.encoding != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.gss_ctx != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->last_query != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->loop != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->record_class != ((PyTypeObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.result != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.result_param_desc != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.result_row_desc != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.result_status_msg != ((PyObject*)Py_None));
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (((PyObject *)__pyx_v_self->__pyx_base.scram) != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (((PyObject *)__pyx_v_self->settings) != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (((PyObject *)__pyx_v_self->statement) != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->timeout_handle != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->__pyx_base.transport != Py_None);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_17 = __pyx_t_18;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_self->waiter != Py_None);
    __pyx_t_17 = __pyx_t_18;
    __pyx_L6_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_17;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None
 *     if use_setstate:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_134522893);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_134522893);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_mstate_global->__pyx_int_134522893) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, Py_None) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_15);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 13, __pyx_L1_error);
    __pyx_t_15 = 0;
    __pyx_t_16 = 0;
    __pyx_r = __pyx_t_14;
    __pyx_t_14 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._execute_iter is not None or self._execute_portal_name is not None or self._execute_stmt_name is not None or self.address is not None or self.buffer is not None or self.cancel_sent_waiter is not None or self.cancel_waiter is not None or self.con_params is not None or self.conref is not None or self.create_future is not None or self.encoding is not None or self.gss_ctx is not None or self.last_query is not None or self.loop is not None or self.record_class is not None or self.result is not None or self.result_param_desc is not None or self.result_row_desc is not None or self.result_status_msg is not None or self.scram is not None or self.settings is not None or self.statement is not None or self.timeout_handle is not None or self.transport is not None or self.waiter is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, None), state
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_134522893);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_134522893);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_mstate_global->__pyx_int_134522893) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_state) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(9, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_14);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_16);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16) != (0)) __PYX_ERR(9, 15, __pyx_L1_error);
    __pyx_t_14 = 0;
    __pyx_t_16 = 0;
    __pyx_r = __pyx_t_15;
    __pyx_t_15 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(9, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(9, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 16, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(9, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_12BaseProtocol_76__setstate_cython__(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "(tree fragment)":17
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(9, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(9, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.BaseProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1006
 * 
 * class Timer:
 *     def __init__(self, budget):             # <<<<<<<<<<<<<<
 *         self._budget = budget
 *         self._started = 0
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_budget = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_budget,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1006, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1006, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1006, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1006, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1006, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_budget = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1006, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(__pyx_self, __pyx_v_self, __pyx_v_budget);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_budget) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "asyncpg/protocol/protocol.pyx":1007
 * class Timer:
 *     def __init__(self, budget):
 *         self._budget = budget             # <<<<<<<<<<<<<<
 *         self._started = 0
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2, __pyx_v_budget) < (0)) __PYX_ERR(0, 1007, __pyx_L1_error)

  /* "asyncpg/protocol/protocol.pyx":1008
 *     def __init__(self, budget):
 *         self._budget = budget
 *         self._started = 0             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 1008, __pyx_L1_error)

  /* "asyncpg/protocol/protocol.pyx":1006
 * 
 * class Timer:
 *     def __init__(self, budget):             # <<<<<<<<<<<<<<
 *         self._budget = budget
 *         self._started = 0
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1010
 *         self._started = 0
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._started = time.monotonic()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_3__enter__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1010, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__enter__", 0) < (0)) __PYX_ERR(0, 1010, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, i); __PYX_ERR(0, 1010, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1010, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__enter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1010, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(__pyx_self, __pyx_v_self);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "asyncpg/protocol/protocol.pyx":1011
 * 
 *     def __enter__(self):
 *         if self._budget is not None:             # <<<<<<<<<<<<<<
 *             self._started = time.monotonic()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":1012
 *     def __enter__(self):
 *         if self._budget is not None:
 *             self._started = time.monotonic()             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, et, e, tb):
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_monotonic); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started, __pyx_t_1) < (0)) __PYX_ERR(0, 1012, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "asyncpg/protocol/protocol.pyx":1011
 * 
 *     def __enter__(self):
 *         if self._budget is not None:             # <<<<<<<<<<<<<<
 *             self._started = time.monotonic()
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":1010
 *         self._started = 0
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._started = time.monotonic()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1014
 *             self._started = time.monotonic()
 * 
 *     def __exit__(self, et, e, tb):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._budget -= time.monotonic() - self._started
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_5__exit__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_et = 0;
  CYTHON_UNUSED PyObject *__pyx_v_e = 0;
  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_et,&__pyx_mstate_global->__pyx_n_u_e,&__pyx_mstate_global->__pyx_n_u_tb,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1014, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__exit__", 0) < (0)) __PYX_ERR(0, 1014, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, i); __PYX_ERR(0, 1014, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1014, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1014, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1014, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1014, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_et = values[1];
    __pyx_v_e = values[2];
    __pyx_v_tb = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1014, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(__pyx_self, __pyx_v_self, __pyx_v_et, __pyx_v_e, __pyx_v_tb);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_et, CYTHON_UNUSED PyObject *__pyx_v_e, CYTHON_UNUSED PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "asyncpg/protocol/protocol.pyx":1015
 * 
 *     def __exit__(self, et, e, tb):
 *         if self._budget is not None:             # <<<<<<<<<<<<<<
 *             self._budget -= time.monotonic() - self._started
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":1016
 *     def __exit__(self, et, e, tb):
 *         if self._budget is not None:
 *             self._budget -= time.monotonic() - self._started             # <<<<<<<<<<<<<<
 * 
 *     def get_remaining_budget(self):
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_monotonic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_started); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2, __pyx_t_6) < (0)) __PYX_ERR(0, 1016, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "asyncpg/protocol/protocol.pyx":1015
 * 
 *     def __exit__(self, et, e, tb):
 *         if self._budget is not None:             # <<<<<<<<<<<<<<
 *             self._budget -= time.monotonic() - self._started
 * 
*/
  }

  /* "asyncpg/protocol/protocol.pyx":1014
 *             self._started = time.monotonic()
 * 
 *     def __exit__(self, et, e, tb):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._budget -= time.monotonic() - self._started
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1018
 *             self._budget -= time.monotonic() - self._started
 * 
 *     def get_remaining_budget(self):             # <<<<<<<<<<<<<<
 *         return self._budget
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget = {"get_remaining_budget", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_remaining_budget (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1018, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1018, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_remaining_budget", 0) < (0)) __PYX_ERR(0, 1018, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_remaining_budget", 1, 1, 1, i); __PYX_ERR(0, 1018, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1018, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_remaining_budget", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1018, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.get_remaining_budget", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(__pyx_self, __pyx_v_self);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_6get_remaining_budget(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_remaining_budget", 0);

  /* "asyncpg/protocol/protocol.pyx":1019
 * 
 *     def get_remaining_budget(self):
 *         return self._budget             # <<<<<<<<<<<<<<
 * 
 *     def has_budget_greater_than(self, amount):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":1018
 *             self._budget -= time.monotonic() - self._started
 * 
 *     def get_remaining_budget(self):             # <<<<<<<<<<<<<<
 *         return self._budget
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.get_remaining_budget", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1021
 *         return self._budget
 * 
 *     def has_budget_greater_than(self, amount):             # <<<<<<<<<<<<<<
 *         if self._budget is None:
 *             # Unlimited budget.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than = {"has_budget_greater_than", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_amount = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_budget_greater_than (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_amount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1021, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "has_budget_greater_than", 0) < (0)) __PYX_ERR(0, 1021, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("has_budget_greater_than", 1, 2, 2, i); __PYX_ERR(0, 1021, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_amount = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("has_budget_greater_than", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1021, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.has_budget_greater_than", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(__pyx_self, __pyx_v_self, __pyx_v_amount);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_5Timer_8has_budget_greater_than(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_amount) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_budget_greater_than", 0);

  /* "asyncpg/protocol/protocol.pyx":1022
 * 
 *     def has_budget_greater_than(self, amount):
 *         if self._budget is None:             # <<<<<<<<<<<<<<
 *             # Unlimited budget.
 *             return True
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "asyncpg/protocol/protocol.pyx":1024
 *         if self._budget is None:
 *             # Unlimited budget.
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return self._budget > amount
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "asyncpg/protocol/protocol.pyx":1022
 * 
 *     def has_budget_greater_than(self, amount):
 *         if self._budget is None:             # <<<<<<<<<<<<<<
 *             # Unlimited budget.
 *             return True
*/
  }

  /* "asyncpg/protocol/protocol.pyx":1026
 *             return True
 *         else:
 *             return self._budget > amount             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_budget_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_amount, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1026, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "asyncpg/protocol/protocol.pyx":1021
 *         return self._budget
 * 
 *     def has_budget_greater_than(self, amount):             # <<<<<<<<<<<<<<
 *         if self._budget is None:
 *             # Unlimited budget.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.Timer.has_budget_greater_than", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "asyncpg/protocol/protocol.pyx":1033
 * 
 * 
 * def _create_record(object mapping, tuple elems):             # <<<<<<<<<<<<<<
 *     # Exposed only for testing purposes.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record = {"_create_record", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_1_create_record(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_mapping = 0;
  PyObject *__pyx_v_elems = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_record (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mapping,&__pyx_mstate_global->__pyx_n_u_elems,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1033, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1033, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1033, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_create_record", 0) < (0)) __PYX_ERR(0, 1033, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, i); __PYX_ERR(0, 1033, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1033, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1033, __pyx_L3_error)
    }
    __pyx_v_mapping = values[0];
    __pyx_v_elems = ((PyObject*)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_record", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1033, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol._create_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elems), (&PyTuple_Type), 1, "elems", 1))) __PYX_ERR(0, 1033, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol__create_record(__pyx_self, __pyx_v_mapping, __pyx_v_elems);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol__create_record(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mapping, PyObject *__pyx_v_elems) {
  PyObject *__pyx_v_rec = 0;
  int32_t __pyx_v_i;
  PyObject *__pyx_v_desc = NULL;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int32_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_create_record", 0);

  /* "asyncpg/protocol/protocol.pyx":1040
 *         int32_t i
 * 
 *     if mapping is None:             # <<<<<<<<<<<<<<
 *         desc = RecordDescriptor({}, ())
 *     else:
*/
  __pyx_t_1 = (__pyx_v_mapping == Py_None);
  if (__pyx_t_1) {

    /* "asyncpg/protocol/protocol.pyx":1041
 * 
 *     if mapping is None:
 *         desc = RecordDescriptor({}, ())             # <<<<<<<<<<<<<<
 *     else:
 *         desc = RecordDescriptor(
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_desc = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":1040
 *         int32_t i
 * 
 *     if mapping is None:             # <<<<<<<<<<<<<<
 *         desc = RecordDescriptor({}, ())
 *     else:
*/
    goto __pyx_L3;
  }

  /* "asyncpg/protocol/protocol.pyx":1043
 *         desc = RecordDescriptor({}, ())
 *     else:
 *         desc = RecordDescriptor(             # <<<<<<<<<<<<<<
 *             mapping, tuple(mapping) if mapping else ())
 * 
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RecordDescriptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "asyncpg/protocol/protocol.pyx":1044
 *     else:
 *         desc = RecordDescriptor(
 *             mapping, tuple(mapping) if mapping else ())             # <<<<<<<<<<<<<<
 * 
 *     rec = desc.make_record(Record, len(elems))
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mapping); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1044, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_mapping); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __pyx_t_3 = __pyx_mstate_global->__pyx_empty_tuple;
    }
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_mapping, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_desc = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "asyncpg/protocol/protocol.pyx":1046
 *             mapping, tuple(mapping) if mapping else ())
 * 
 *     rec = desc.make_record(Record, len(elems))             # <<<<<<<<<<<<<<
 *     for i in range(len(elems)):
 *         elem = elems[i]
*/
  __pyx_t_5 = __pyx_v_desc;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Record); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(__pyx_v_elems == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1046, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1046, __pyx_L1_error)
  __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_make_record, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_rec = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1047
 * 
 *     rec = desc.make_record(Record, len(elems))
 *     for i in range(len(elems)):             # <<<<<<<<<<<<<<
 *         elem = elems[i]
 *         cpython.Py_INCREF(elem)
*/
  if (unlikely(__pyx_v_elems == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 1047, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_v_elems); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1047, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "asyncpg/protocol/protocol.pyx":1048
 *     rec = desc.make_record(Record, len(elems))
 *     for i in range(len(elems)):
 *         elem = elems[i]             # <<<<<<<<<<<<<<
 *         cpython.Py_INCREF(elem)
 *         recordcapi.ApgRecord_SET_ITEM(rec, i, elem)
*/
    if (unlikely(__pyx_v_elems == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1048, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_elems, __pyx_v_i, int32_t, 1, __Pyx_PyLong_From_int32_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "asyncpg/protocol/protocol.pyx":1049
 *     for i in range(len(elems)):
 *         elem = elems[i]
 *         cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *         recordcapi.ApgRecord_SET_ITEM(rec, i, elem)
 *     return rec
*/
    Py_INCREF(__pyx_v_elem);

    /* "asyncpg/protocol/protocol.pyx":1050
 *         elem = elems[i]
 *         cpython.Py_INCREF(elem)
 *         recordcapi.ApgRecord_SET_ITEM(rec, i, elem)             # <<<<<<<<<<<<<<
 *     return rec
*/
    ApgRecord_SET_ITEM(__pyx_v_rec, __pyx_v_i, __pyx_v_elem);
  }

  /* "asyncpg/protocol/protocol.pyx":1051
 *         cpython.Py_INCREF(elem)
 *         recordcapi.ApgRecord_SET_ITEM(rec, i, elem)
 *     return rec             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rec);
  __pyx_r = __pyx_v_rec;
  goto __pyx_L0;

  /* "asyncpg/protocol/protocol.pyx":1033
 * 
 * 
 * def _create_record(object mapping, tuple elems):             # <<<<<<<<<<<<<<
 *     # Exposed only for testing purposes.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("asyncpg.protocol.protocol._create_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rec);
  __Pyx_XDECREF(__pyx_v_desc);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig = {"__pyx_unpickle_DataCodecConfig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_DataCodecConfig", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DataCodecConfig", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_2__pyx_unpickle_DataCodecConfig(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')             # <<<<<<<<<<<<<<
 *     __pyx_result = DataCodecConfig.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, __pyx_k_custom_type_codecs__derived_typ); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
 *     __pyx_result = DataCodecConfig.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
 *     __pyx_result = DataCodecConfig.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = DataCodecConfig.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(9, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
 *     __pyx_result = DataCodecConfig.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):
 *     __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_DataCodecConfig__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_DataCodecConfig__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):
 *     __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_custom_type_codecs);
  __Pyx_DECREF(__pyx_v___pyx_result->_custom_type_codecs);
  __pyx_v___pyx_result->_custom_type_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_derived_type_codecs);
  __Pyx_DECREF(__pyx_v___pyx_result->_derived_type_codecs);
  __pyx_v___pyx_result->_derived_type_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):
 *     __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 2); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_DataCodecConfig__set_state(<DataCodecConfig> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_DataCodecConfig__set_state(DataCodecConfig __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._custom_type_codecs = __pyx_state[0]; __pyx_result._derived_type_codecs = __pyx_state[1]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 2)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_DataCodecConfig__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol = {"__pyx_unpickle_CoreProtocol", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_CoreProtocol", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CoreProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_4__pyx_unpickle_CoreProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')             # <<<<<<<<<<<<<<
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, __pyx_k_discard_data__execute_iter__exe); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(9, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')
 *     __pyx_result = CoreProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_CoreProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xa7a9ac8, 0xf0eeb4b, 0x55a24b7, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _skip_discard, address, backend_pid, backend_secret, buffer, con_params, con_status, encoding, gss_ctx, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, scram, state, transport, xact_status')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 23)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_CoreProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int32_t __pyx_t_3;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_5;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_6;
  enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CoreProtocol__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 23)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_discard_data = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_execute_iter);
  __Pyx_DECREF(__pyx_v___pyx_result->_execute_iter);
  __pyx_v___pyx_result->_execute_iter = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_execute_portal_name);
  __Pyx_DECREF(__pyx_v___pyx_result->_execute_portal_name);
  __pyx_v___pyx_result->_execute_portal_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_execute_stmt_name);
  __Pyx_DECREF(__pyx_v___pyx_result->_execute_stmt_name);
  __pyx_v___pyx_result->_execute_stmt_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_skip_discard = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->address);
  __Pyx_DECREF(__pyx_v___pyx_result->address);
  __pyx_v___pyx_result->address = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->backend_pid = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->backend_secret = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->buffer);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->buffer);
  __pyx_v___pyx_result->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->con_params);
  __Pyx_DECREF(__pyx_v___pyx_result->con_params);
  __pyx_v___pyx_result->con_params = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->con_status = __pyx_t_4;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->encoding);
  __Pyx_DECREF(__pyx_v___pyx_result->encoding);
  __pyx_v___pyx_result->encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->gss_ctx);
  __Pyx_DECREF(__pyx_v___pyx_result->gss_ctx);
  __pyx_v___pyx_result->gss_ctx = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->result);
  __Pyx_DECREF(__pyx_v___pyx_result->result);
  __pyx_v___pyx_result->result = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->result_execute_completed = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->result_param_desc);
  __Pyx_DECREF(__pyx_v___pyx_result->result_param_desc);
  __pyx_v___pyx_result->result_param_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->result_row_desc);
  __Pyx_DECREF(__pyx_v___pyx_result->result_row_desc);
  __pyx_v___pyx_result->result_row_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->result_status_msg);
  __Pyx_DECREF(__pyx_v___pyx_result->result_status_msg);
  __pyx_v___pyx_result->result_status_msg = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->result_type = __pyx_t_5;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->scram);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->scram);
  __pyx_v___pyx_result->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->state = __pyx_t_6;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->transport);
  __Pyx_DECREF(__pyx_v___pyx_result->transport);
  __pyx_v___pyx_result->transport = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->xact_status = __pyx_t_7;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 23)             # <<<<<<<<<<<<<<
*/
  __pyx_t_8 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 23); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_CoreProtocol__set_state(<CoreProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CoreProtocol__set_state(CoreProtocol __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._skip_discard = __pyx_state[4]; __pyx_result.address = __pyx_state[5]; __pyx_result.backend_pid = __pyx_state[6]; __pyx_result.backend_secret = __pyx_state[7]; __pyx_result.buffer = __pyx_state[8]; __pyx_result.con_params = __pyx_state[9]; __pyx_result.con_status = __pyx_state[10]; __pyx_result.encoding = __pyx_state[11]; __pyx_result.gss_ctx = __pyx_state[12]; __pyx_result.result = __pyx_state[13]; __pyx_result.result_execute_completed = __pyx_state[14]; __pyx_result.result_param_desc = __pyx_state[15]; __pyx_result.result_row_desc = __pyx_state[16]; __pyx_result.result_status_msg = __pyx_state[17]; __pyx_result.result_type = __pyx_state[18]; __pyx_result.scram = __pyx_state[19]; __pyx_result.state = __pyx_state[20]; __pyx_result.transport = __pyx_state[21]; __pyx_result.xact_status = __pyx_state[22]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 23)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_CoreProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol = {"__pyx_unpickle_BaseProtocol", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(9, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_BaseProtocol", 0) < (0)) __PYX_ERR(9, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, i); __PYX_ERR(9, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(9, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(9, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(9, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BaseProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(9, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(9, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7asyncpg_8protocol_8protocol_6__pyx_unpickle_BaseProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')             # <<<<<<<<<<<<<<
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, __pyx_k_discard_data__execute_iter__exe_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(9, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
 *     __pyx_result = BaseProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 40)
*/

static PyObject *__pyx_f_7asyncpg_8protocol_8protocol___pyx_unpickle_BaseProtocol__set_state(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int32_t __pyx_t_3;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __pyx_t_4;
  uint64_t __pyx_t_5;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __pyx_t_6;
  enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __pyx_t_7;
  enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_BaseProtocol__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 40)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base._discard_data = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_iter);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_iter);
  __pyx_v___pyx_result->__pyx_base._execute_iter = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_portal_name);
  __pyx_v___pyx_result->__pyx_base._execute_portal_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base._execute_stmt_name);
  __pyx_v___pyx_result->__pyx_base._execute_stmt_name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_is_ssl = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base._skip_discard = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.address);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.address);
  __pyx_v___pyx_result->__pyx_base.address = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.backend_pid = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyLong_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.backend_secret = __pyx_t_3;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer);
  __pyx_v___pyx_result->__pyx_base.buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cancel_sent_waiter);
  __Pyx_DECREF(__pyx_v___pyx_result->cancel_sent_waiter);
  __pyx_v___pyx_result->cancel_sent_waiter = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cancel_waiter);
  __Pyx_DECREF(__pyx_v___pyx_result->cancel_waiter);
  __pyx_v___pyx_result->cancel_waiter = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->closing = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.con_params);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.con_params);
  __pyx_v___pyx_result->__pyx_base.con_params = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.con_status = __pyx_t_4;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->conref);
  __Pyx_DECREF(__pyx_v___pyx_result->conref);
  __pyx_v___pyx_result->conref = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->create_future);
  __Pyx_DECREF(__pyx_v___pyx_result->create_future);
  __pyx_v___pyx_result->create_future = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.encoding);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.encoding);
  __pyx_v___pyx_result->__pyx_base.encoding = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.gss_ctx);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.gss_ctx);
  __pyx_v___pyx_result->__pyx_base.gss_ctx = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->is_reading = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->last_query);
  __Pyx_DECREF(__pyx_v___pyx_result->last_query);
  __pyx_v___pyx_result->last_query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->loop);
  __Pyx_DECREF(__pyx_v___pyx_result->loop);
  __pyx_v___pyx_result->loop = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->queries_count = __pyx_t_5;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("type", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->record_class);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->record_class);
  __pyx_v___pyx_result->record_class = ((PyTypeObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result);
  __pyx_v___pyx_result->__pyx_base.result = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.result_execute_completed = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_param_desc);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_param_desc);
  __pyx_v___pyx_result->__pyx_base.result_param_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_row_desc);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_row_desc);
  __pyx_v___pyx_result->__pyx_base.result_row_desc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 28, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.result_status_msg);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.result_status_msg);
  __pyx_v___pyx_result->__pyx_base.result_status_msg = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 29, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.result_type = __pyx_t_6;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 30, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->return_extra = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 31, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.scram);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.scram);
  __pyx_v___pyx_result->__pyx_base.scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 32, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->settings);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->settings);
  __pyx_v___pyx_result->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 33, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.state = __pyx_t_7;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 34, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState))))) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->statement);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->statement);
  __pyx_v___pyx_result->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 35, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->timeout_handle);
  __Pyx_DECREF(__pyx_v___pyx_result->timeout_handle);
  __pyx_v___pyx_result->timeout_handle = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 36, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.transport);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.transport);
  __pyx_v___pyx_result->__pyx_base.transport = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 37, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->waiter);
  __Pyx_DECREF(__pyx_v___pyx_result->waiter);
  __pyx_v___pyx_result->waiter = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 38, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->writing_paused = __pyx_t_2;
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 39, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = ((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)__Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.xact_status = __pyx_t_8;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 40)             # <<<<<<<<<<<<<<
*/
  __pyx_t_9 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 40); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(9, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_BaseProtocol__set_state(<BaseProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_BaseProtocol__set_state(BaseProtocol __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._discard_data = __pyx_state[0]; __pyx_result._execute_iter = __pyx_state[1]; __pyx_result._execute_portal_name = __pyx_state[2]; __pyx_result._execute_stmt_name = __pyx_state[3]; __pyx_result._is_ssl = __pyx_state[4]; __pyx_result._skip_discard = __pyx_state[5]; __pyx_result.address = __pyx_state[6]; __pyx_result.backend_pid = __pyx_state[7]; __pyx_result.backend_secret = __pyx_state[8]; __pyx_result.buffer = __pyx_state[9]; __pyx_result.cancel_sent_waiter = __pyx_state[10]; __pyx_result.cancel_waiter = __pyx_state[11]; __pyx_result.closing = __pyx_state[12]; __pyx_result.con_params = __pyx_state[13]; __pyx_result.con_status = __pyx_state[14]; __pyx_result.conref = __pyx_state[15]; __pyx_result.create_future = __pyx_state[16]; __pyx_result.encoding = __pyx_state[17]; __pyx_result.gss_ctx = __pyx_state[18]; __pyx_result.is_reading = __pyx_state[19]; __pyx_result.last_query = __pyx_state[20]; __pyx_result.loop = __pyx_state[21]; __pyx_result.queries_count = __pyx_state[22]; __pyx_result.record_class = __pyx_state[23]; __pyx_result.result = __pyx_state[24]; __pyx_result.result_execute_completed = __pyx_state[25]; __pyx_result.result_param_desc = __pyx_state[26]; __pyx_result.result_row_desc = __pyx_state[27]; __pyx_result.result_status_msg = __pyx_state[28]; __pyx_result.result_type = __pyx_state[29]; __pyx_result.return_extra = __pyx_state[30]; __pyx_result.scram = __pyx_state[31]; __pyx_result.settings = __pyx_state[32]; __pyx_result.state = __pyx_state[33]; __pyx_result.statement = __pyx_state[34]; __pyx_result.timeout_handle = __pyx_state[35]; __pyx_result.transport = __pyx_state[36]; __pyx_result.waiter = __pyx_state[37]; __pyx_result.writing_paused = __pyx_state[38]; __pyx_result.xact_status = __pyx_state[39]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 40)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("asyncpg.protocol.protocol.__pyx_unpickle_BaseProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CodecMap __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap;
  p->extra_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CodecMap(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->extra_codecs);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CodecMap(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->extra_codecs) {
    e = (*v)(p->extra_codecs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *)o;
  tmp = ((PyObject*)p->extra_codecs);
  p->extra_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_CodecMap[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_CodecMap_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CodecMap},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_CodecMap},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_CodecMap},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec = {
  "asyncpg.protocol.protocol.CodecMap",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_CodecMap_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_CodecMap = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""CodecMap", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CodecMap, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CodecMap, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_CodecMap, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_CodecMap, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_CodecMap, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_Codec __pyx_vtable_7asyncpg_8protocol_8protocol_Codec;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->schema = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->kind = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None);
  p->py_encoder = Py_None; Py_INCREF(Py_None);
  p->py_decoder = Py_None; Py_INCREF(Py_None);
  p->element_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None);
  p->element_type_oids = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->element_names = Py_None; Py_INCREF(Py_None);
  p->record_desc = Py_None; Py_INCREF(Py_None);
  p->element_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  Py_CLEAR(p->schema);
  Py_CLEAR(p->kind);
  Py_CLEAR(p->base_codec);
  Py_CLEAR(p->py_encoder);
  Py_CLEAR(p->py_decoder);
  Py_CLEAR(p->element_codec);
  Py_CLEAR(p->element_type_oids);
  Py_CLEAR(p->element_names);
  Py_CLEAR(p->record_desc);
  Py_CLEAR(p->element_codecs);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->base_codec) {
    e = (*v)(((PyObject *)p->base_codec), a); if (e) return e;
  }
  if (p->py_encoder) {
    e = (*v)(p->py_encoder, a); if (e) return e;
  }
  if (p->py_decoder) {
    e = (*v)(p->py_decoder, a); if (e) return e;
  }
  if (p->element_codec) {
    e = (*v)(((PyObject *)p->element_codec), a); if (e) return e;
  }
  if (p->element_type_oids) {
    e = (*v)(p->element_type_oids, a); if (e) return e;
  }
  if (p->element_names) {
    e = (*v)(p->element_names, a); if (e) return e;
  }
  if (p->record_desc) {
    e = (*v)(p->record_desc, a); if (e) return e;
  }
  if (p->element_codecs) {
    e = (*v)(p->element_codecs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)o;
  tmp = ((PyObject*)p->base_codec);
  p->base_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->py_encoder);
  p->py_encoder = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->py_decoder);
  p->py_decoder = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->element_codec);
  p->element_codec = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->element_type_oids);
  p->element_type_oids = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->element_names);
  p->element_names = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->record_desc);
  p->record_desc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->element_codecs);
  p->element_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_Codec[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_Codec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec},
  {Py_tp_repr, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_Codec},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_Codec},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_Codec_spec = {
  "asyncpg.protocol.protocol.Codec",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_Codec_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_Codec = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""Codec", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_Codec, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7asyncpg_8protocol_8protocol_5Codec_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_Codec, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_Codec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_Codec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_Codec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_DataCodecConfig __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig;
  p->_derived_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_custom_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_derived_type_codecs);
  Py_CLEAR(p->_custom_type_codecs);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_derived_type_codecs) {
    e = (*v)(p->_derived_type_codecs, a); if (e) return e;
  }
  if (p->_custom_type_codecs) {
    e = (*v)(p->_custom_type_codecs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)o;
  tmp = ((PyObject*)p->_derived_type_codecs);
  p->_derived_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_custom_type_codecs);
  p->_custom_type_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig[] = {
  {"add_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"add_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"remove_python_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_set_builtin_type_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"set_builtin_type_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"clear_type_cache", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"declare_fallback_codec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig},
  {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec = {
  "asyncpg.protocol.protocol.DataCodecConfig",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""DataCodecConfig", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7asyncpg_8protocol_8protocol_15DataCodecConfig_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_DataCodecConfig, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_ConnectionSettings __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext*)__pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings;
  p->_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_codec = Py_None; Py_INCREF(Py_None);
  p->_settings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_encoding);
  Py_CLEAR(p->_codec);
  Py_CLEAR(p->_settings);
  Py_CLEAR(p->_data_codecs);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings);
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->_codec) {
    e = (*v)(p->_codec, a); if (e) return e;
  }
  if (p->_settings) {
    e = (*v)(p->_settings, a); if (e) return e;
  }
  if (p->_data_codecs) {
    e = (*v)(((PyObject *)p->_data_codecs), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings); }
  tmp = ((PyObject*)p->_codec);
  p->_codec = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_settings);
  p->_settings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_data_codecs);
  p->_data_codecs = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__(o, n);
  }
  return v;
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings[] = {
  {"__getattr__", (PyCFunction)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_17__getattr__, METH_O|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {Py_tp_repr, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__},
  {Py_tp_getattro, (void *)__pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec = {
  "asyncpg.protocol.protocol.ConnectionSettings",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""ConnectionSettings", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7asyncpg_8protocol_8protocol_18ConnectionSettings_19__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_ConnectionSettings, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_SCRAMAuthentication __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
  p->authentication_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->authorization_message = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->client_channel_binding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->client_first_message_bare = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->client_nonce = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->client_proof = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->password_salt = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->server_first_message = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->server_key = Py_None; Py_INCREF(Py_None);
  p->server_nonce = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->authentication_method);
  Py_CLEAR(p->authorization_message);
  Py_CLEAR(p->client_channel_binding);
  Py_CLEAR(p->client_first_message_bare);
  Py_CLEAR(p->client_nonce);
  Py_CLEAR(p->client_proof);
  Py_CLEAR(p->password_salt);
  Py_CLEAR(p->server_first_message);
  Py_CLEAR(p->server_key);
  Py_CLEAR(p->server_nonce);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->server_key) {
    e = (*v)(p->server_key, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)o;
  tmp = ((PyObject*)p->server_key);
  p->server_key = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authentication_method(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authentication_method_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authorization_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_21authorization_message_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_channel_binding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_22client_channel_binding_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_first_message_bare(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_25client_first_message_bare_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_nonce(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_nonce_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_proof(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12client_proof_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_salt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_13password_salt_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_iterations(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_19password_iterations_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_first_message(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_20server_first_message_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_key(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_10server_key_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_nonce(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_12server_nonce_1__get__(o);
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication[] = {
  {"authentication_method", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authentication_method, 0, 0, 0},
  {"authorization_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_authorization_message, 0, 0, 0},
  {"client_channel_binding", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_channel_binding, 0, 0, 0},
  {"client_first_message_bare", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_first_message_bare, 0, 0, 0},
  {"client_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_nonce, 0, 0, 0},
  {"client_proof", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_client_proof, 0, 0, 0},
  {"password_salt", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_salt, 0, 0, 0},
  {"password_iterations", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_password_iterations, 0, 0, 0},
  {"server_first_message", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_first_message, 0, 0, 0},
  {"server_key", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_key, 0, 0, 0},
  {"server_nonce", __pyx_getprop_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_server_nonce, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {Py_tp_doc, (void *)PyDoc_STR("Contains the protocol for generating and a SCRAM hashed password.\n\n    Since PostgreSQL 10, the option to hash passwords using the SCRAM-SHA-256\n    method was added. This module follows the defined protocol, which can be\n    referenced from here:\n\n    https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256\n\n    libpq references the following RFCs that it uses for implementation:\n\n        * RFC 5802\n        * RFC 5803\n        * RFC 7677\n\n    The protocol works as such:\n\n    - A client connets to the server. The server requests the client to begin\n    SASL authentication using SCRAM and presents a client with the methods it\n    supports. At present, those are SCRAM-SHA-256, and, on servers that are\n    built with OpenSSL and\n    are PG11+, SCRAM-SHA-256-PLUS (which supports channel binding, more on that\n    below)\n\n    - The client sends a \"first message\" to the server, where it chooses which\n    method to authenticate with, and sends, along with the method, an indication\n    of channel binding (we disable for now), a nonce, and the username.\n    (Technically, PostgreSQL ignores the username as it already has it from the\n    initical connection, but we add it for completeness)\n\n    - The server responds with a \"first message\" in which it extends the nonce,\n    as well as a password salt and the number of iterations to hash the password\n    with. The client validates that the new nonce contains the first part of the\n    client's original nonce\n\n    - The client generates a salted password, but does not sent this up to the\n    server. Instead, the client follows the SCRAM algorithm (RFC5802) to\n    generate a proof. This proof is sent aspart of a client \"final message\" to\n    the server for it to validate.\n\n    - The server validates the proof. If it is valid, the server sends a\n    verification code for the client to verify that the server came to the same\n    proof the client did. PostgreSQL i""mmediately sends an AuthenticationOK\n    response right after a valid negotiation. If the password the client\n    provided was invalid, then authentication fails.\n\n    (The beauty of this is that the salted password is never transmitted over\n    the wire!)\n\n    PostgreSQL 11 added support for the channel binding (i.e.\n    SCRAM-SHA-256-PLUS) but to do some ongoing discussion, there is a conscious\n    decision by several driver authors to not support it as of yet. As such, the\n    channel binding parameter is hard-coded to \"n\" for now, but can be updated\n    to support other channel binding methos in the future\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec = {
  "asyncpg.protocol.protocol.SCRAMAuthentication",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""SCRAMAuthentication", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("Contains the protocol for generating and a SCRAM hashed password.\n\n    Since PostgreSQL 10, the option to hash passwords using the SCRAM-SHA-256\n    method was added. This module follows the defined protocol, which can be\n    referenced from here:\n\n    https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256\n\n    libpq references the following RFCs that it uses for implementation:\n\n        * RFC 5802\n        * RFC 5803\n        * RFC 7677\n\n    The protocol works as such:\n\n    - A client connets to the server. The server requests the client to begin\n    SASL authentication using SCRAM and presents a client with the methods it\n    supports. At present, those are SCRAM-SHA-256, and, on servers that are\n    built with OpenSSL and\n    are PG11+, SCRAM-SHA-256-PLUS (which supports channel binding, more on that\n    below)\n\n    - The client sends a \"first message\" to the server, where it chooses which\n    method to authenticate with, and sends, along with the method, an indication\n    of channel binding (we disable for now), a nonce, and the username.\n    (Technically, PostgreSQL ignores the username as it already has it from the\n    initical connection, but we add it for completeness)\n\n    - The server responds with a \"first message\" in which it extends the nonce,\n    as well as a password salt and the number of iterations to hash the password\n    with. The client validates that the new nonce contains the first part of the\n    client's original nonce\n\n    - The client generates a salted password, but does not sent this up to the\n    server. Instead, the client follows the SCRAM algorithm (RFC5802) to\n    generate a proof. This proof is sent aspart of a client \"final message\" to\n    the server for it to validate.\n\n    - The server validates the proof. If it is valid, the server sends a\n    verification code for the client to verify that the server came to the same\n    proof the client did. PostgreSQL i""mmediately sends an AuthenticationOK\n    response right after a valid negotiation. If the password the client\n    provided was invalid, then authentication fails.\n\n    (The beauty of this is that the salted password is never transmitted over\n    the wire!)\n\n    PostgreSQL 11 added support for the channel binding (i.e.\n    SCRAM-SHA-256-PLUS) but to do some ongoing discussion, there is a conscious\n    decision by several driver authors to not support it as of yet. As such, the\n    channel binding parameter is hard-coded to \"n\" for now, but can be updated\n    to support other channel binding methos in the future\n    "), /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_SCRAMAuthentication, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol;
  p->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  p->_execute_iter = Py_None; Py_INCREF(Py_None);
  p->_execute_portal_name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_execute_stmt_name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->transport = Py_None; Py_INCREF(Py_None);
  p->address = Py_None; Py_INCREF(Py_None);
  p->con_params = Py_None; Py_INCREF(Py_None);
  p->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); Py_INCREF(Py_None);
  p->gss_ctx = Py_None; Py_INCREF(Py_None);
  p->result = Py_None; Py_INCREF(Py_None);
  p->result_param_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->result_row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->result_status_msg = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->buffer);
  Py_CLEAR(p->_execute_iter);
  Py_CLEAR(p->_execute_portal_name);
  Py_CLEAR(p->_execute_stmt_name);
  Py_CLEAR(p->encoding);
  Py_CLEAR(p->transport);
  Py_CLEAR(p->address);
  Py_CLEAR(p->con_params);
  Py_CLEAR(p->scram);
  Py_CLEAR(p->gss_ctx);
  Py_CLEAR(p->result);
  Py_CLEAR(p->result_param_desc);
  Py_CLEAR(p->result_row_desc);
  Py_CLEAR(p->result_status_msg);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->buffer) {
    e = (*v)(((PyObject *)p->buffer), a); if (e) return e;
  }
  if (p->_execute_iter) {
    e = (*v)(p->_execute_iter, a); if (e) return e;
  }
  if (p->transport) {
    e = (*v)(p->transport, a); if (e) return e;
  }
  if (p->address) {
    e = (*v)(p->address, a); if (e) return e;
  }
  if (p->con_params) {
    e = (*v)(p->con_params, a); if (e) return e;
  }
  if (p->scram) {
    e = (*v)(((PyObject *)p->scram), a); if (e) return e;
  }
  if (p->gss_ctx) {
    e = (*v)(p->gss_ctx, a); if (e) return e;
  }
  if (p->result) {
    e = (*v)(p->result, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *)o;
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_execute_iter);
  p->_execute_iter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->transport);
  p->transport = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->address);
  p->address = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->con_params);
  p->con_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->scram);
  p->scram = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->gss_ctx);
  p->gss_ctx = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result);
  p->result = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_11backend_pid_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_14backend_secret_1__get__(o);
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol[] = {
  {"backend_pid", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_pid, 0, 0, 0},
  {"backend_secret", __pyx_getprop_7asyncpg_8protocol_8protocol_12CoreProtocol_backend_secret, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol},
  {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol},
  {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec = {
  "asyncpg.protocol.protocol.CoreProtocol",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""CoreProtocol", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7asyncpg_8protocol_8protocol_12CoreProtocol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_PreparedStatementState __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 1);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o);
  p->__pyx_vtab = __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->query = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
  p->row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->parameters_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None);
  p->args_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->cols_desc = Py_None; Py_INCREF(Py_None);
  p->rows_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  Py_CLEAR(p->query);
  Py_CLEAR(p->record_class);
  Py_CLEAR(p->row_desc);
  Py_CLEAR(p->parameters_desc);
  Py_CLEAR(p->settings);
  Py_CLEAR(p->args_codecs);
  Py_CLEAR(p->cols_desc);
  Py_CLEAR(p->rows_codecs);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->record_class) {
    e = (*v)(((PyObject *)p->record_class), a); if (e) return e;
  }
  if (p->row_desc) {
    e = (*v)(p->row_desc, a); if (e) return e;
  }
  if (p->parameters_desc) {
    e = (*v)(p->parameters_desc, a); if (e) return e;
  }
  if (p->settings) {
    e = (*v)(((PyObject *)p->settings), a); if (e) return e;
  }
  if (p->args_codecs) {
    e = (*v)(p->args_codecs, a); if (e) return e;
  }
  if (p->cols_desc) {
    e = (*v)(p->cols_desc, a); if (e) return e;
  }
  if (p->rows_codecs) {
    e = (*v)(p->rows_codecs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)o;
  tmp = ((PyObject*)p->record_class);
  p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->row_desc);
  p->row_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parameters_desc);
  p->parameters_desc = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->settings);
  p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args_codecs);
  p->args_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cols_desc);
  p->cols_desc = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rows_codecs);
  p->rows_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4name_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5query_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_6closed_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_prepared(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_8prepared_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_4refs_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_record_class(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_12record_class_1__get__(o);
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_ignore_custom_codec(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19ignore_custom_codec_1__get__(o);
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState[] = {
  {"_get_parameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_get_attributes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_init_types", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"attach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"detach", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"mark_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"mark_unprepared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState[] = {
  {"name", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_name, 0, 0, 0},
  {"query", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_query, 0, 0, 0},
  {"closed", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_closed, 0, 0, 0},
  {"prepared", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_prepared, 0, 0, 0},
  {"refs", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_refs, 0, 0, 0},
  {"record_class", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_record_class, 0, 0, 0},
  {"ignore_custom_codec", __pyx_getprop_7asyncpg_8protocol_8protocol_22PreparedStatementState_ignore_custom_codec, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec = {
  "asyncpg.protocol.protocol.PreparedStatementState",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""PreparedStatementState", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_PreparedStatementState, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_BaseProtocol __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol;

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p;
  PyObject *o = __pyx_tp_new_7asyncpg_8protocol_8protocol_CoreProtocol(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7asyncpg_8protocol_8protocol_CoreProtocol*)__pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol;
  p->loop = Py_None; Py_INCREF(Py_None);
  p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None);
  p->cancel_sent_waiter = Py_None; Py_INCREF(Py_None);
  p->cancel_waiter = Py_None; Py_INCREF(Py_None);
  p->waiter = Py_None; Py_INCREF(Py_None);
  p->create_future = Py_None; Py_INCREF(Py_None);
  p->timeout_handle = Py_None; Py_INCREF(Py_None);
  p->conref = Py_None; Py_INCREF(Py_None);
  p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
  p->last_query = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->settings);
  Py_CLEAR(p->cancel_sent_waiter);
  Py_CLEAR(p->cancel_waiter);
  Py_CLEAR(p->waiter);
  Py_CLEAR(p->create_future);
  Py_CLEAR(p->timeout_handle);
  Py_CLEAR(p->conref);
  Py_CLEAR(p->record_class);
  Py_CLEAR(p->last_query);
  Py_CLEAR(p->statement);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_CoreProtocol(o);
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o;
  e = __pyx_tp_traverse_7asyncpg_8protocol_8protocol_CoreProtocol(o, v, a); if (e) return e;
  if (p->loop) {
    e = (*v)(p->loop, a); if (e) return e;
  }
  if (p->settings) {
    e = (*v)(((PyObject *)p->settings), a); if (e) return e;
  }
  if (p->cancel_sent_waiter) {
    e = (*v)(p->cancel_sent_waiter, a); if (e) return e;
  }
  if (p->cancel_waiter) {
    e = (*v)(p->cancel_waiter, a); if (e) return e;
  }
  if (p->waiter) {
    e = (*v)(p->waiter, a); if (e) return e;
  }
  if (p->create_future) {
    e = (*v)(p->create_future, a); if (e) return e;
  }
  if (p->timeout_handle) {
    e = (*v)(p->timeout_handle, a); if (e) return e;
  }
  if (p->conref) {
    e = (*v)(p->conref, a); if (e) return e;
  }
  if (p->record_class) {
    e = (*v)(((PyObject *)p->record_class), a); if (e) return e;
  }
  if (p->statement) {
    e = (*v)(((PyObject *)p->statement), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *)o;
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_CoreProtocol(o);
  tmp = ((PyObject*)p->loop);
  p->loop = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->settings);
  p->settings = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cancel_sent_waiter);
  p->cancel_sent_waiter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cancel_waiter);
  p->cancel_waiter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->waiter);
  p->waiter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->create_future);
  p->create_future = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->timeout_handle);
  p->timeout_handle = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->conref);
  p->conref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->record_class);
  p->record_class = ((PyTypeObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->statement);
  p->statement = ((struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_1__get__(o);
}

static int __pyx_setprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_6is_ssl_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_13queries_count_1__get__(o);
}

static PyMethodDef __pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol[] = {
  {"set_connection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_server_pid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_settings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_record_class", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"prepare", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"bind_execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"bind_execute_many", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"bind", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"execute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"close_portal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_out", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_in", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"close_statement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_closed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_connected", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"abort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_request_cancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_on_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_on_waiter_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_create_future_fallback", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_get_timeout", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_is_cancelling", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_wait_for_cancellation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"data_received", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"connection_made", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"connection_lost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"pause_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"resume_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol[] = {
  {"is_ssl", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, __pyx_setprop_7asyncpg_8protocol_8protocol_12BaseProtocol_is_ssl, 0, 0},
  {"queries_count", __pyx_getprop_7asyncpg_8protocol_8protocol_12BaseProtocol_queries_count, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol},
  {Py_tp_methods, (void *)__pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol},
  {Py_tp_getset, (void *)__pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol},
  {Py_tp_init, (void *)__pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec = {
  "asyncpg.protocol.protocol.BaseProtocol",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""BaseProtocol", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_7asyncpg_8protocol_8protocol_12BaseProtocol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol_BaseProtocol, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_a_i);
  Py_CLEAR(p->__pyx_v_b_i);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_a_i) {
    e = (*v)(p->__pyx_v_a_i, a); if (e) return e;
  }
  if (p->__pyx_v_b_i) {
    e = (*v)(p->__pyx_v_b_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct__genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_c);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password *)o;
  tmp = ((PyObject*)p->__pyx_v_c);
  p->__pyx_v_c = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password},
  {Py_tp_clear, (void *)__pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_1__normalize_password",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_1__normalize_password", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_traverse*/
  __pyx_tp_clear_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_c);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_in_prohibited_table);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_in_prohibited_table) {
    e = (*v)(p->__pyx_v_in_prohibited_table, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_3_genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_3_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_c);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_4_genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_4_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_c);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_c) {
    e = (*v)(p->__pyx_v_c, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_5_genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_5_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_ignore_custom_codec);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_record_class);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_stmt_name);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_ignore_custom_codec) {
    e = (*v)(p->__pyx_v_ignore_custom_codec, a); if (e) return e;
  }
  if (p->__pyx_v_query) {
    e = (*v)(p->__pyx_v_query, a); if (e) return e;
  }
  if (p->__pyx_v_record_class) {
    e = (*v)(p->__pyx_v_record_class, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_stmt_name) {
    e = (*v)(p->__pyx_v_stmt_name, a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_6_prepare",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_6_prepare", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_args_buf);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_limit);
  Py_CLEAR(p->__pyx_v_portal_name);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_args_buf) {
    e = (*v)(p->__pyx_v_args_buf, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_7_bind_execute",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_7_bind_execute", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_arg_bufs);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_data_gen);
  Py_CLEAR(p->__pyx_v_e);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_genexpr);
  Py_CLEAR(p->__pyx_v_portal_name);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_timer);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  Py_CLEAR(p->__pyx_t_6);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_arg_bufs) {
    e = (*v)(p->__pyx_v_arg_bufs, a); if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_data_gen) {
    e = (*v)(p->__pyx_v_data_gen, a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_genexpr) {
    e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_timer) {
    e = (*v)(p->__pyx_v_timer, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  if (p->__pyx_t_6) {
    e = (*v)(p->__pyx_t_6, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_8_bind_execute_many",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_8_bind_execute_many", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_b);
  Py_CLEAR(p->__pyx_v_i);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_b) {
    e = (*v)(p->__pyx_v_b, a); if (e) return e;
  }
  if (p->__pyx_v_i) {
    e = (*v)(p->__pyx_v_i, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_9_genexpr",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_9_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_args_buf);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_portal_name);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_args_buf) {
    e = (*v)(p->__pyx_v_args_buf, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_10_bind",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_10_bind", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_portal_name);
  Py_CLEAR(p->__pyx_v_return_extra);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_return_extra) {
    e = (*v)(p->__pyx_v_return_extra, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_11_execute",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_11_execute", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_portal_name);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_12_close_portal",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_12_close_portal", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_query) {
    e = (*v)(p->__pyx_v_query, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_13_query",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_13_query", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buffer);
  Py_CLEAR(p->__pyx_v_copy_stmt);
  Py_CLEAR(p->__pyx_v_done);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_sink);
  Py_CLEAR(p->__pyx_v_status_msg);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_timer);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  Py_CLEAR(p->__pyx_t_6);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_buffer) {
    e = (*v)(p->__pyx_v_buffer, a); if (e) return e;
  }
  if (p->__pyx_v_copy_stmt) {
    e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e;
  }
  if (p->__pyx_v_done) {
    e = (*v)(p->__pyx_v_done, a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_sink) {
    e = (*v)(p->__pyx_v_sink, a); if (e) return e;
  }
  if (p->__pyx_v_status_msg) {
    e = (*v)(p->__pyx_v_status_msg, a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_timer) {
    e = (*v)(p->__pyx_v_timer, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  if (p->__pyx_t_6) {
    e = (*v)(p->__pyx_t_6, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_14_copy_out",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_14_copy_out", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_aiter);
  Py_CLEAR(p->__pyx_v_chunk);
  Py_CLEAR(p->__pyx_v_codec);
  Py_CLEAR(p->__pyx_v_codecs);
  Py_CLEAR(p->__pyx_v_copy_stmt);
  Py_CLEAR(p->__pyx_v_data);
  Py_CLEAR(p->__pyx_v_e);
  Py_CLEAR(p->__pyx_v_item);
  Py_CLEAR(p->__pyx_v_iterator);
  Py_CLEAR(p->__pyx_v_reader);
  Py_CLEAR(p->__pyx_v_record_stmt);
  Py_CLEAR(p->__pyx_v_records);
  Py_CLEAR(p->__pyx_v_row);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_settings);
  Py_CLEAR(p->__pyx_v_status_msg);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_timer);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_v_wbuf);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  Py_CLEAR(p->__pyx_t_6);
  Py_CLEAR(p->__pyx_t_7);
  Py_CLEAR(p->__pyx_t_10);
  Py_CLEAR(p->__pyx_t_11);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_aiter) {
    e = (*v)(p->__pyx_v_aiter, a); if (e) return e;
  }
  if (p->__pyx_v_chunk) {
    e = (*v)(p->__pyx_v_chunk, a); if (e) return e;
  }
  if (p->__pyx_v_codec) {
    e = (*v)(((PyObject *)p->__pyx_v_codec), a); if (e) return e;
  }
  if (p->__pyx_v_codecs) {
    e = (*v)(p->__pyx_v_codecs, a); if (e) return e;
  }
  if (p->__pyx_v_copy_stmt) {
    e = (*v)(p->__pyx_v_copy_stmt, a); if (e) return e;
  }
  if (p->__pyx_v_data) {
    e = (*v)(p->__pyx_v_data, a); if (e) return e;
  }
  if (p->__pyx_v_e) {
    e = (*v)(p->__pyx_v_e, a); if (e) return e;
  }
  if (p->__pyx_v_item) {
    e = (*v)(p->__pyx_v_item, a); if (e) return e;
  }
  if (p->__pyx_v_iterator) {
    e = (*v)(p->__pyx_v_iterator, a); if (e) return e;
  }
  if (p->__pyx_v_reader) {
    e = (*v)(p->__pyx_v_reader, a); if (e) return e;
  }
  if (p->__pyx_v_record_stmt) {
    e = (*v)(((PyObject *)p->__pyx_v_record_stmt), a); if (e) return e;
  }
  if (p->__pyx_v_records) {
    e = (*v)(p->__pyx_v_records, a); if (e) return e;
  }
  if (p->__pyx_v_row) {
    e = (*v)(p->__pyx_v_row, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_settings) {
    e = (*v)(((PyObject *)p->__pyx_v_settings), a); if (e) return e;
  }
  if (p->__pyx_v_status_msg) {
    e = (*v)(p->__pyx_v_status_msg, a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_timer) {
    e = (*v)(p->__pyx_v_timer, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_v_wbuf) {
    e = (*v)(((PyObject *)p->__pyx_v_wbuf), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  if (p->__pyx_t_6) {
    e = (*v)(p->__pyx_t_6, a); if (e) return e;
  }
  if (p->__pyx_t_7) {
    e = (*v)(p->__pyx_t_7, a); if (e) return e;
  }
  if (p->__pyx_t_10) {
    e = (*v)(p->__pyx_t_10, a); if (e) return e;
  }
  if (p->__pyx_t_11) {
    e = (*v)(p->__pyx_t_11, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_15_copy_in",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_15_copy_in", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_state);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_v_waiter);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  Py_CLEAR(p->__pyx_t_4);
  Py_CLEAR(p->__pyx_t_5);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_state) {
    e = (*v)(((PyObject *)p->__pyx_v_state), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_v_waiter) {
    e = (*v)(p->__pyx_v_waiter, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  if (p->__pyx_t_4) {
    e = (*v)(p->__pyx_t_4, a); if (e) return e;
  }
  if (p->__pyx_t_5) {
    e = (*v)(p->__pyx_t_5, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_16_close_statement",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_16_close_statement", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_timeout);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_timeout) {
    e = (*v)(p->__pyx_v_timeout, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_17_close",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_17_close", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[--__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyObject *o) {
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation))))
  {
    __pyx_mstate_global->__pyx_freelist_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation[__pyx_mstate_global->__pyx_freecount_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation++] = ((struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *p = (struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation},
  {Py_tp_new, (void *)__pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation},
  {0, 0},
};
static PyType_Spec __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec = {
  "asyncpg.protocol.protocol.__pyx_scope_struct_18__wait_for_cancellation",
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_slots,
};
#else

static PyTypeObject __pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = {
  PyVarObject_HEAD_INIT(0, 0)
  "asyncpg.protocol.protocol.""__pyx_scope_struct_18__wait_for_cancellation", /*tp_name*/
  sizeof(struct __pyx_obj_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_k = Py_None; Py_INCREF(Py_None);
  __pyx_7genexpr__pyx_v_7asyncpg_8protocol_8protocol_v = Py_None; Py_INCREF(Py_None);
  __pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k = Py_None; Py_INCREF(Py_None);
  __pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap = &__pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.get_binary_codec_ptr = (void *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_binary_codec_ptr;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.set_binary_codec_ptr = (void (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_binary_codec_ptr;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.get_text_codec_ptr = (void *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_get_text_codec_ptr;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CodecMap.set_text_codec_ptr = (void (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CodecMap *, uint32_t, void *))__pyx_f_7asyncpg_8protocol_8protocol_8CodecMap_set_text_codec_ptr;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap)) __PYX_ERR(1, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_CodecMap_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap = &__pyx_type_7asyncpg_8protocol_8protocol_CodecMap;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CodecMap, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap) < (0)) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec = &__pyx_vtable_7asyncpg_8protocol_8protocol_Codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.init = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, PyObject *, PyObject *, PyObject *, Py_UCS4))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_init;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_scalar = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_scalar;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_array = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_array_text = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_array_text;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_range = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_range;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_multirange = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_multirange;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_composite = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_composite;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode_in_python = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode_in_python;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_scalar = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_scalar;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_array = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_array_text = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_array_text;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_range = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_range;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_multirange = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_multirange;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_composite = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_composite;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode_in_python = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode_in_python;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.encode = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_encode;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.decode = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_decode;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.has_encoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_encoder;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.has_decoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_has_decoder;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.is_binary = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_is_binary;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.copy = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_copy;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_array_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, Py_UCS4))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_array_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_range_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_range_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_multirange_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_multirange_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_composite_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_composite_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_Codec.new_python_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(uint32_t, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, __pyx_t_7asyncpg_8protocol_8protocol_encode_func, __pyx_t_7asyncpg_8protocol_8protocol_decode_func, struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat))__pyx_f_7asyncpg_8protocol_8protocol_5Codec_new_python_codec;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec)) __PYX_ERR(1, 43, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_Codec_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec = &__pyx_type_7asyncpg_8protocol_8protocol_Codec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec, __pyx_vtabptr_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Codec, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_Codec) < (0)) __PYX_ERR(1, 43, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig = &__pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig;
  __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig.get_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_DataCodecConfig.get_custom_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_DataCodecConfig *, uint32_t, enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat))__pyx_f_7asyncpg_8protocol_8protocol_15DataCodecConfig_get_custom_codec;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig)) __PYX_ERR(1, 509, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig = &__pyx_type_7asyncpg_8protocol_8protocol_DataCodecConfig;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_vtabptr_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DataCodecConfig, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig) < (0)) __PYX_ERR(1, 509, __pyx_L1_error)
  __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext = __Pyx_ImportType_3_2_8(__pyx_t_1, "asyncpg.pgproto.pgproto", "CodecContext",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext),
  #else
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_CodecContext*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base = *__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_CodecContext;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base.get_text_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_text_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.__pyx_base.is_encoding_utf8 = (PyObject *(*)(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_is_encoding_utf8;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.add_setting = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_setting;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.register_data_types = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_register_data_types;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.add_python_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_add_python_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.remove_python_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_remove_python_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.clear_type_cache = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_clear_type_cache;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.set_builtin_type_codec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_set_builtin_type_codec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_ConnectionSettings.get_data_codec = (struct __pyx_obj_7asyncpg_8protocol_8protocol_Codec *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_ConnectionSettings *, uint32_t, int __pyx_skip_dispatch, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_18ConnectionSettings_get_data_codec;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings)) __PYX_ERR(8, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings = &__pyx_type_7asyncpg_8protocol_8protocol_ConnectionSettings;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings->tp_base = __pyx_mstate_global->__pyx_ptype_7asyncpg_7pgproto_7pgproto_CodecContext;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_vtabptr_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ConnectionSettings, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings) < (0)) __PYX_ERR(8, 11, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication = &__pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.create_client_first_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_first_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.create_client_final_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_create_client_final_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.parse_server_first_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_parse_server_first_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication.verify_server_final_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_verify_server_final_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._bytes_xor = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__bytes_xor;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_client_nonce = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, int))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_nonce;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_client_proof = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_client_proof;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._generate_salted_password = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__generate_salted_password;
  __pyx_vtable_7asyncpg_8protocol_8protocol_SCRAMAuthentication._normalize_password = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_SCRAMAuthentication *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_19SCRAMAuthentication__normalize_password;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication)) __PYX_ERR(3, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication = &__pyx_type_7asyncpg_8protocol_8protocol_SCRAMAuthentication;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_vtabptr_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication) < (0)) __PYX_ERR(3, 17, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol.is_in_transaction = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol_is_in_transaction;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__auth = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__auth;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__prepare = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__prepare;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind_execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind_execute_many = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind_execute_many;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__close_stmt_portal = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__close_stmt_portal;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__simple_query;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__bind;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_out_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_out_data;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._process__copy_in_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__process__copy_in_data;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_authentication = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_authentication;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_parameter_status = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_parameter_status;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_notification;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_backend_key_data = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_backend_key_data;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_ready_for_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_ready_for_query;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_data_msgs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_data_msgs;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_copy_data_msgs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_copy_data_msgs;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_error_response = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_error_response;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._parse_msg_command_complete = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__parse_msg_command_complete;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_data_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_data_msg;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_done_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_done_msg;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write_copy_fail_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write_copy_fail_msg;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_cleartext = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_cleartext;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_md5 = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_md5;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_sasl_initial = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_initial;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_password_message_sasl_continue = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_password_message_sasl_continue;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_init_gssapi = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_gssapi;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_init_sspi = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_init_sspi;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_get_service = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_get_service;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._auth_gss_step = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__auth_gss_step;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._write = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__write;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._writelines = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__writelines;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._read_server_messages = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__read_server_messages;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._push_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__push_result;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._reset_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__reset_result;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._set_state = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_state;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._ensure_connected = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__ensure_connected;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_parse_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_parse_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_bind_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_bind_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_empty_bind_data = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_empty_bind_data;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._build_execute_message = (struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__build_execute_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._connect = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__connect;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._prepare_and_describe = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__prepare_and_describe;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._send_parse_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_parse_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._send_bind_message = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__send_bind_message;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many = (int (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many_more = (int (*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_more;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind_execute_many_fail = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind_execute_many_fail;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__bind;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._execute = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int32_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__execute;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._close = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, int))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__close;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__simple_query;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_out;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__copy_in;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._terminate = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__terminate;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__decode_row;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_result;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notification;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_notice = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_notice;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._set_server_parameter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__set_server_parameter;
  __pyx_vtable_7asyncpg_8protocol_8protocol_CoreProtocol._on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12CoreProtocol__on_connection_lost;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol)) __PYX_ERR(15, 24, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_CoreProtocol;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CoreProtocol, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol) < (0)) __PYX_ERR(15, 24, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState = &__pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._encode_bind_msg = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *, struct __pyx_opt_args_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg *__pyx_optional_args))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__encode_bind_msg;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._init_codecs = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, int __pyx_skip_dispatch))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__init_codecs;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._ensure_rows_decoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_rows_decoder;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._ensure_args_encoder = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__ensure_args_encoder;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._set_row_desc = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_row_desc;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._set_args_desc = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__set_args_desc;
  __pyx_vtable_7asyncpg_8protocol_8protocol_PreparedStatementState._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_PreparedStatementState *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_22PreparedStatementState__decode_row;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState)) __PYX_ERR(17, 11, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState = &__pyx_type_7asyncpg_8protocol_8protocol_PreparedStatementState;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_vtabptr_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PreparedStatementState, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState) < (0)) __PYX_ERR(17, 11, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base = *__pyx_vtabptr_7asyncpg_8protocol_8protocol_CoreProtocol;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._write = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__write;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._writelines = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__writelines;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._decode_row = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, char const *, Py_ssize_t))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__decode_row;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_notification = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notification;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_notice = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_notice;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._set_server_parameter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__set_server_parameter;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.__pyx_base._on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_CoreProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_connection_lost;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.get_connection = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_get_connection;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._get_timeout_impl = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__get_timeout_impl;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._check_state = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__check_state;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._new_waiter = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__new_waiter;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._coreproto_error = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__coreproto_error;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__connect = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__connect;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__prepare = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__prepare;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__bind_and_exec = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind_and_exec;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__close_stmt_or_portal = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__close_stmt_or_portal;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__simple_query = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__simple_query;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__bind = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__bind;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__copy_out = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_out;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._on_result__copy_in = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__on_result__copy_in;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._handle_waiter_on_connection_lost = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *, PyObject *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__handle_waiter_on_connection_lost;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol._dispatch_result = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol__dispatch_result;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.resume_reading = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_resume_reading;
  __pyx_vtable_7asyncpg_8protocol_8protocol_BaseProtocol.pause_reading = (PyObject *(*)(struct __pyx_obj_7asyncpg_8protocol_8protocol_BaseProtocol *))__pyx_f_7asyncpg_8protocol_8protocol_12BaseProtocol_pause_reading;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol)) __PYX_ERR(0, 76, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol = &__pyx_type_7asyncpg_8protocol_8protocol_BaseProtocol;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_base = __pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_vtabptr_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_BaseProtocol, (PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol) < (0)) __PYX_ERR(0, 76, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr)) __PYX_ERR(3, 188, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(3, 188, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(3, 188, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password)) __PYX_ERR(3, 256, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < (0)) __PYX_ERR(3, 256, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password) < (0)) __PYX_ERR(3, 256, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_1__normalize_password->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr)) __PYX_ERR(3, 287, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(3, 287, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(3, 287, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr)) __PYX_ERR(3, 313, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(3, 313, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(3, 313, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr)) __PYX_ERR(3, 327, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(3, 327, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(3, 327, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr)) __PYX_ERR(3, 336, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(3, 336, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(3, 336, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare)) __PYX_ERR(0, 139, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_6_prepare->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute)) __PYX_ERR(0, 167, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_7_bind_execute->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many)) __PYX_ERR(0, 207, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_8_bind_execute_many->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 228, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 228, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 228, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_9_genexpr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind)) __PYX_ERR(0, 268, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < (0)) __PYX_ERR(0, 268, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind) < (0)) __PYX_ERR(0, 268, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_10_bind->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute)) __PYX_ERR(0, 296, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < (0)) __PYX_ERR(0, 296, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute) < (0)) __PYX_ERR(0, 296, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_11_execute->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal)) __PYX_ERR(0, 325, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < (0)) __PYX_ERR(0, 325, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal) < (0)) __PYX_ERR(0, 325, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_12_close_portal->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query)) __PYX_ERR(0, 347, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < (0)) __PYX_ERR(0, 347, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query) < (0)) __PYX_ERR(0, 347, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_13_query->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out)) __PYX_ERR(0, 371, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < (0)) __PYX_ERR(0, 371, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out) < (0)) __PYX_ERR(0, 371, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_14_copy_out->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in)) __PYX_ERR(0, 424, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < (0)) __PYX_ERR(0, 424, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in) < (0)) __PYX_ERR(0, 424, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_15_copy_in->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement)) __PYX_ERR(0, 562, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < (0)) __PYX_ERR(0, 562, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement) < (0)) __PYX_ERR(0, 562, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_16_close_statement->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close)) __PYX_ERR(0, 602, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < (0)) __PYX_ERR(0, 602, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close) < (0)) __PYX_ERR(0, 602, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_17_close->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation)) __PYX_ERR(0, 744, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation_spec, __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < (0)) __PYX_ERR(0, 744, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation = &__pyx_type_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation) < (0)) __PYX_ERR(0, 744, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_dictoffset && __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7asyncpg_8protocol_8protocol___pyx_scope_struct_18__wait_for_cancellation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(20, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(21, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(22, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer = __Pyx_ImportType_3_2_8(__pyx_t_1, "asyncpg.pgproto.pgproto", "WriteBuffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer),
  #else
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer) __PYX_ERR(6, 15, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_WriteBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(6, 15, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer = __Pyx_ImportType_3_2_8(__pyx_t_1, "asyncpg.pgproto.pgproto", "ReadBuffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer),
  #else
  sizeof(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_ReadBuffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer) __PYX_ERR(6, 75, __pyx_L1_error)
  __pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer = (struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_ReadBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7asyncpg_7pgproto_7pgproto_ReadBuffer); if (unlikely(!__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(6, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  {
    __pyx_t_1 = PyImport_ImportModule("asyncpg.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_PyObject_struct___pyx_obj_7async);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 528;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_as_pg_string_and_size, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_binary, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_encode_text, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_encode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_encode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bits_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bool_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_box_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_bytea_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_cidr_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_circle_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_date_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_float8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_hstore_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_inet_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int2_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_int8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_interval_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonb_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_jsonpath_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_line_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_lseg_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_binary, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_numeric_decode_text, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_path_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_pg_snapshot_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_point_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_poly_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_text_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_tid_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_time_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamp_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timestamptz_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_timetz_decode_tuple, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint4_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uint8_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_uuid_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_void_decode, (void (**)(void))&__pyx_f_7asyncpg_7pgproto_7pgproto_frb_check, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_8(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_protocol(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_protocol},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "protocol",
      0, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_protocol(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_protocol(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_protocol(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  size_t __pyx_t_10;
  static Py_UCS4 __pyx_t_11[5];
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'protocol' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "protocol" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit_protocol", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_asyncpg__protocol__protocol) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "asyncpg.protocol.protocol")) {
      if (unlikely((PyDict_SetItemString(modules, "asyncpg.protocol.protocol", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "asyncpg/protocol/protocol.pyx":13
 * cimport cpython
 * 
 * import asyncio             # <<<<<<<<<<<<<<
 * import builtins
 * import codecs
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncio, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asyncio, __pyx_t_2) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":14
 * 
 * import asyncio
 * import builtins             # <<<<<<<<<<<<<<
 * import codecs
 * import collections.abc
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_builtins, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_builtins, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":15
 * import asyncio
 * import builtins
 * import codecs             # <<<<<<<<<<<<<<
 * import collections.abc
 * import socket
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_codecs, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_codecs, __pyx_t_2) < (0)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":16
 * import builtins
 * import codecs
 * import collections.abc             # <<<<<<<<<<<<<<
 * import socket
 * import time
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":17
 * import codecs
 * import collections.abc
 * import socket             # <<<<<<<<<<<<<<
 * import time
 * import weakref
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_socket, __pyx_t_2) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":18
 * import collections.abc
 * import socket
 * import time             # <<<<<<<<<<<<<<
 * import weakref
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_2) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":19
 * import socket
 * import time
 * import weakref             # <<<<<<<<<<<<<<
 * 
 * from asyncpg.pgproto.pgproto cimport (
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_weakref, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_weakref, __pyx_t_2) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":43
 *                          INT32_MAX, UINT32_MAX
 * 
 * from asyncpg.exceptions import _base as apg_exc_base             # <<<<<<<<<<<<<<
 * from asyncpg import compat
 * from asyncpg import types as apg_types
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_base};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg_exceptions, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_base};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_exc_base, __pyx_t_4) < (0)) __PYX_ERR(0, 43, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":44
 * 
 * from asyncpg.exceptions import _base as apg_exc_base
 * from asyncpg import compat             # <<<<<<<<<<<<<<
 * from asyncpg import types as apg_types
 * from asyncpg import exceptions as apg_exc
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compat};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compat};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 44, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":45
 * from asyncpg.exceptions import _base as apg_exc_base
 * from asyncpg import compat
 * from asyncpg import types as apg_types             # <<<<<<<<<<<<<<
 * from asyncpg import exceptions as apg_exc
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_types, __pyx_t_4) < (0)) __PYX_ERR(0, 45, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":46
 * from asyncpg import compat
 * from asyncpg import types as apg_types
 * from asyncpg import exceptions as apg_exc             # <<<<<<<<<<<<<<
 * 
 * from asyncpg.pgproto cimport hton
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_exc, __pyx_t_4) < (0)) __PYX_ERR(0, 46, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":49
 * 
 * from asyncpg.pgproto cimport hton
 * from asyncpg.protocol.record import Record, RecordDescriptor             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Record,__pyx_mstate_global->__pyx_n_u_RecordDescriptor};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg_protocol_record, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Record,__pyx_mstate_global->__pyx_n_u_RecordDescriptor};
    for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":116
 * DEF ANYCOMPATIBLERANGEOID = 5080
 * 
 * ARRAY_TYPES = {_TEXTOID, _OIDOID}             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_OID_MAP = {
*/
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_int_1009) < (0)) __PYX_ERR(23, 116, __pyx_L1_error)
  if (PySet_Add(__pyx_t_2, __pyx_mstate_global->__pyx_int_1028) < (0)) __PYX_ERR(23, 116, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ARRAY_TYPES, __pyx_t_2) < (0)) __PYX_ERR(23, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":119
 * 
 * BUILTIN_TYPE_OID_MAP = {
 *     ABSTIMEOID: 'abstime',             # <<<<<<<<<<<<<<
 *     ACLITEMOID: 'aclitem',
 *     ANYARRAYOID: 'anyarray',
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(100); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_702, __pyx_mstate_global->__pyx_n_u_abstime) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1033, __pyx_mstate_global->__pyx_n_u_aclitem) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2277, __pyx_mstate_global->__pyx_n_u_anyarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5078, __pyx_mstate_global->__pyx_n_u_anycompatiblearray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4538, __pyx_mstate_global->__pyx_n_u_anycompatiblemultirange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5079, __pyx_mstate_global->__pyx_n_u_anycompatiblenonarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5077, __pyx_mstate_global->__pyx_n_u_anycompatible) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5080, __pyx_mstate_global->__pyx_n_u_anycompatiblerange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2283, __pyx_mstate_global->__pyx_n_u_anyelement) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3500, __pyx_mstate_global->__pyx_n_u_anyenum) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4537, __pyx_mstate_global->__pyx_n_u_anymultirange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2776, __pyx_mstate_global->__pyx_n_u_anynonarray) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2276, __pyx_mstate_global->__pyx_n_u_any) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3831, __pyx_mstate_global->__pyx_n_u_anyrange) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1560, __pyx_mstate_global->__pyx_n_u_bit) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_16, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_603, __pyx_mstate_global->__pyx_n_u_box) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1042, __pyx_mstate_global->__pyx_n_u_bpchar) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_17, __pyx_mstate_global->__pyx_n_u_bytea) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_18, __pyx_mstate_global->__pyx_n_u_char) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_29, __pyx_mstate_global->__pyx_n_u_cid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_650, __pyx_mstate_global->__pyx_n_u_cidr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_718, __pyx_mstate_global->__pyx_n_u_circle) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2275, __pyx_mstate_global->__pyx_n_u_cstring) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1082, __pyx_mstate_global->__pyx_n_u_date) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3838, __pyx_mstate_global->__pyx_n_u_event_trigger) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3115, __pyx_mstate_global->__pyx_n_u_fdw_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_700, __pyx_mstate_global->__pyx_n_u_float4) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_701, __pyx_mstate_global->__pyx_n_u_float8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3642, __pyx_mstate_global->__pyx_n_u_gtsvector) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_325, __pyx_mstate_global->__pyx_n_u_index_am_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_869, __pyx_mstate_global->__pyx_n_u_inet) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_21, __pyx_mstate_global->__pyx_n_u_int2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_23, __pyx_mstate_global->__pyx_n_u_int4) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_20, __pyx_mstate_global->__pyx_n_u_int8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2281, __pyx_mstate_global->__pyx_n_u_internal) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1186, __pyx_mstate_global->__pyx_n_u_interval) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3802, __pyx_mstate_global->__pyx_n_u_jsonb) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_114, __pyx_mstate_global->__pyx_n_u_json) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4072, __pyx_mstate_global->__pyx_n_u_jsonpath) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2280, __pyx_mstate_global->__pyx_n_u_language_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_628, __pyx_mstate_global->__pyx_n_u_line) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_601, __pyx_mstate_global->__pyx_n_u_lseg) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_774, __pyx_mstate_global->__pyx_n_u_macaddr8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_829, __pyx_mstate_global->__pyx_n_u_macaddr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_790, __pyx_mstate_global->__pyx_n_u_money) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_19, __pyx_mstate_global->__pyx_n_u_name) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1700, __pyx_mstate_global->__pyx_n_u_numeric) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_26, __pyx_mstate_global->__pyx_n_u_oid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2282, __pyx_mstate_global->__pyx_n_u_opaque) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_602, __pyx_mstate_global->__pyx_n_u_path) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4600, __pyx_mstate_global->__pyx_n_u_pg_brin_bloom_summary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4601, __pyx_mstate_global->__pyx_n_u_pg_brin_minmax_multi_summary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_32, __pyx_mstate_global->__pyx_n_u_pg_ddl_command) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3402, __pyx_mstate_global->__pyx_n_u_pg_dependencies) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3220, __pyx_mstate_global->__pyx_n_u_pg_lsn) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5017, __pyx_mstate_global->__pyx_n_u_pg_mcv_list) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3361, __pyx_mstate_global->__pyx_n_u_pg_ndistinct) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_194, __pyx_mstate_global->__pyx_n_u_pg_node_tree) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5038, __pyx_mstate_global->__pyx_n_u_pg_snapshot) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_600, __pyx_mstate_global->__pyx_n_u_point) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_604, __pyx_mstate_global->__pyx_n_u_polygon) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2249, __pyx_mstate_global->__pyx_n_u_record) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1790, __pyx_mstate_global->__pyx_n_u_refcursor) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2205, __pyx_mstate_global->__pyx_n_u_regclass) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4191, __pyx_mstate_global->__pyx_n_u_regcollation) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3734, __pyx_mstate_global->__pyx_n_u_regconfig) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3769, __pyx_mstate_global->__pyx_n_u_regdictionary) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4089, __pyx_mstate_global->__pyx_n_u_regnamespace) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2204, __pyx_mstate_global->__pyx_n_u_regoperator) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2203, __pyx_mstate_global->__pyx_n_u_regoper) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2202, __pyx_mstate_global->__pyx_n_u_regprocedure) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_24, __pyx_mstate_global->__pyx_n_u_regproc) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_4096, __pyx_mstate_global->__pyx_n_u_regrole) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2206, __pyx_mstate_global->__pyx_n_u_regtype) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_703, __pyx_mstate_global->__pyx_n_u_reltime) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_210, __pyx_mstate_global->__pyx_n_u_smgr) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_269, __pyx_mstate_global->__pyx_n_u_table_am_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_25, __pyx_mstate_global->__pyx_n_u_text) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_27, __pyx_mstate_global->__pyx_n_u_tid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1083, __pyx_mstate_global->__pyx_n_u_time) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1114, __pyx_mstate_global->__pyx_n_u_timestamp) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1184, __pyx_mstate_global->__pyx_n_u_timestamptz) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1266, __pyx_mstate_global->__pyx_n_u_timetz) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_704, __pyx_mstate_global->__pyx_n_u_tinterval) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2279, __pyx_mstate_global->__pyx_n_u_trigger) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3310, __pyx_mstate_global->__pyx_n_u_tsm_handler) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3615, __pyx_mstate_global->__pyx_n_u_tsquery) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_3614, __pyx_mstate_global->__pyx_n_u_tsvector) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2970, __pyx_mstate_global->__pyx_n_u_txid_snapshot) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_705, __pyx_mstate_global->__pyx_n_u_unknown) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2950, __pyx_mstate_global->__pyx_n_u_uuid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1562, __pyx_mstate_global->__pyx_n_u_varbit) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1043, __pyx_mstate_global->__pyx_n_u_varchar) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_2278, __pyx_mstate_global->__pyx_n_u_void) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_5069, __pyx_mstate_global->__pyx_n_u_xid8) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_28, __pyx_mstate_global->__pyx_n_u_xid) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_142, __pyx_mstate_global->__pyx_n_u_xml) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1028, __pyx_mstate_global->__pyx_kp_u_oid_2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_int_1009, __pyx_mstate_global->__pyx_kp_u_text_2) < (0)) __PYX_ERR(23, 119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP, __pyx_t_2) < (0)) __PYX_ERR(23, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":221
 * }
 * 
 * BUILTIN_TYPE_NAME_MAP = {v: k for k, v in BUILTIN_TYPE_OID_MAP.items()}             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['smallint'] = \
*/
  { /* enter inner scope */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 221, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_OID_MAP); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 221, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(23, 221, __pyx_L4_error)
    }
    __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 221, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_8;
    __pyx_t_8 = 0;
    while (1) {
      __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_5, &__pyx_t_3, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6);
      if (unlikely(__pyx_t_9 == 0)) break;
      if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(23, 221, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XGOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v);
      __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, (PyObject*)__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k))) __PYX_ERR(23, 221, __pyx_L4_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, Py_None);
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, Py_None);
    goto __pyx_L7_exit_scope;
    __pyx_L4_error:;
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_k, Py_None);
    __Pyx_GOTREF(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v);
    __Pyx_DECREF_SET(__pyx_8genexpr1__pyx_v_7asyncpg_8protocol_8protocol_v, Py_None);
    goto __pyx_L1_error;
    __pyx_L7_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP, __pyx_t_2) < (0)) __PYX_ERR(23, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":224
 * 
 * BUILTIN_TYPE_NAME_MAP['smallint'] = \
 *     BUILTIN_TYPE_NAME_MAP['int2']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['int'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_int2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":223
 * BUILTIN_TYPE_NAME_MAP = {v: k for k, v in BUILTIN_TYPE_OID_MAP.items()}
 * 
 * BUILTIN_TYPE_NAME_MAP['smallint'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['int2']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_smallint, __pyx_t_4) < 0))) __PYX_ERR(23, 223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":227
 * 
 * BUILTIN_TYPE_NAME_MAP['int'] = \
 *     BUILTIN_TYPE_NAME_MAP['int4']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['integer'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int4); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":226
 *     BUILTIN_TYPE_NAME_MAP['int2']
 * 
 * BUILTIN_TYPE_NAME_MAP['int'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['int4']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int, __pyx_t_2) < 0))) __PYX_ERR(23, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":230
 * 
 * BUILTIN_TYPE_NAME_MAP['integer'] = \
 *     BUILTIN_TYPE_NAME_MAP['int4']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['bigint'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_int4); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":229
 *     BUILTIN_TYPE_NAME_MAP['int4']
 * 
 * BUILTIN_TYPE_NAME_MAP['integer'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['int4']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_integer, __pyx_t_4) < 0))) __PYX_ERR(23, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":233
 * 
 * BUILTIN_TYPE_NAME_MAP['bigint'] = \
 *     BUILTIN_TYPE_NAME_MAP['int8']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['decimal'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_int8); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":232
 *     BUILTIN_TYPE_NAME_MAP['int4']
 * 
 * BUILTIN_TYPE_NAME_MAP['bigint'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['int8']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bigint, __pyx_t_2) < 0))) __PYX_ERR(23, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":236
 * 
 * BUILTIN_TYPE_NAME_MAP['decimal'] = \
 *     BUILTIN_TYPE_NAME_MAP['numeric']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['real'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_numeric); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":235
 *     BUILTIN_TYPE_NAME_MAP['int8']
 * 
 * BUILTIN_TYPE_NAME_MAP['decimal'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['numeric']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_decimal, __pyx_t_4) < 0))) __PYX_ERR(23, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":239
 * 
 * BUILTIN_TYPE_NAME_MAP['real'] = \
 *     BUILTIN_TYPE_NAME_MAP['float4']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['double precision'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_float4); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":238
 *     BUILTIN_TYPE_NAME_MAP['numeric']
 * 
 * BUILTIN_TYPE_NAME_MAP['real'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['float4']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_real, __pyx_t_2) < 0))) __PYX_ERR(23, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":242
 * 
 * BUILTIN_TYPE_NAME_MAP['double precision'] = \
 *     BUILTIN_TYPE_NAME_MAP['float8']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_float8); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":241
 *     BUILTIN_TYPE_NAME_MAP['float4']
 * 
 * BUILTIN_TYPE_NAME_MAP['double precision'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['float8']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_double_precision, __pyx_t_4) < 0))) __PYX_ERR(23, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":245
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \
 *     BUILTIN_TYPE_NAME_MAP['timestamptz']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_timestamptz); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":244
 *     BUILTIN_TYPE_NAME_MAP['float8']
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp with timezone'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['timestamptz']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_timestamp_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":248
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \
 *     BUILTIN_TYPE_NAME_MAP['timestamp']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":247
 *     BUILTIN_TYPE_NAME_MAP['timestamptz']
 * 
 * BUILTIN_TYPE_NAME_MAP['timestamp without timezone'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['timestamp']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_timestamp_without_timezone, __pyx_t_4) < 0))) __PYX_ERR(23, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":251
 * 
 * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \
 *     BUILTIN_TYPE_NAME_MAP['timetz']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_timetz); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":250
 *     BUILTIN_TYPE_NAME_MAP['timestamp']
 * 
 * BUILTIN_TYPE_NAME_MAP['time with timezone'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['timetz']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_time_with_timezone, __pyx_t_2) < 0))) __PYX_ERR(23, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":254
 * 
 * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \
 *     BUILTIN_TYPE_NAME_MAP['time']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['char'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":253
 *     BUILTIN_TYPE_NAME_MAP['timetz']
 * 
 * BUILTIN_TYPE_NAME_MAP['time without timezone'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['time']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_time_without_timezone, __pyx_t_4) < 0))) __PYX_ERR(23, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":257
 * 
 * BUILTIN_TYPE_NAME_MAP['char'] = \
 *     BUILTIN_TYPE_NAME_MAP['bpchar']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['character'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bpchar); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":256
 *     BUILTIN_TYPE_NAME_MAP['time']
 * 
 * BUILTIN_TYPE_NAME_MAP['char'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['bpchar']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_char, __pyx_t_2) < 0))) __PYX_ERR(23, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":260
 * 
 * BUILTIN_TYPE_NAME_MAP['character'] = \
 *     BUILTIN_TYPE_NAME_MAP['bpchar']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['character varying'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_bpchar); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":259
 *     BUILTIN_TYPE_NAME_MAP['bpchar']
 * 
 * BUILTIN_TYPE_NAME_MAP['character'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['bpchar']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_character, __pyx_t_4) < 0))) __PYX_ERR(23, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":263
 * 
 * BUILTIN_TYPE_NAME_MAP['character varying'] = \
 *     BUILTIN_TYPE_NAME_MAP['varchar']             # <<<<<<<<<<<<<<
 * 
 * BUILTIN_TYPE_NAME_MAP['bit varying'] = \
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_varchar); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":262
 *     BUILTIN_TYPE_NAME_MAP['bpchar']
 * 
 * BUILTIN_TYPE_NAME_MAP['character varying'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['varchar']
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_character_varying, __pyx_t_2) < 0))) __PYX_ERR(23, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":266
 * 
 * BUILTIN_TYPE_NAME_MAP['bit varying'] = \
 *     BUILTIN_TYPE_NAME_MAP['varbit']             # <<<<<<<<<<<<<<
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_varbit); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/pgtypes.pxi":265
 *     BUILTIN_TYPE_NAME_MAP['varchar']
 * 
 * BUILTIN_TYPE_NAME_MAP['bit varying'] = \             # <<<<<<<<<<<<<<
 *     BUILTIN_TYPE_NAME_MAP['varbit']
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BUILTIN_TYPE_NAME_MAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_bit_varying, __pyx_t_4) < 0))) __PYX_ERR(23, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/encodings.pyx":14
 * 
 * ENCODINGS_MAP = {
 *     'abc': 'cp1258',             # <<<<<<<<<<<<<<
 *     'alt': 'cp866',
 *     'euc_cn': 'euccn',
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(45); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_alt, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_cn, __pyx_mstate_global->__pyx_n_u_euccn) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_jp, __pyx_mstate_global->__pyx_n_u_eucjp) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_euc_kr, __pyx_mstate_global->__pyx_n_u_euckr) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_koi8r, __pyx_mstate_global->__pyx_n_u_koi8_r) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_koi8u, __pyx_mstate_global->__pyx_n_u_koi8_u) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shift_jis_2004, __pyx_mstate_global->__pyx_n_u_euc_jis_2004) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sjis, __pyx_mstate_global->__pyx_n_u_shift_jis) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sql_ascii, __pyx_mstate_global->__pyx_n_u_ascii) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vscii, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tcvn, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tcvn5712, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_unicode, __pyx_mstate_global->__pyx_n_u_utf_8_2) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win, __pyx_mstate_global->__pyx_n_u_cp1521) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1250, __pyx_mstate_global->__pyx_n_u_cp1250) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1251, __pyx_mstate_global->__pyx_n_u_cp1251) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1252, __pyx_mstate_global->__pyx_n_u_cp1252) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1253, __pyx_mstate_global->__pyx_n_u_cp1253) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1254, __pyx_mstate_global->__pyx_n_u_cp1254) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1255, __pyx_mstate_global->__pyx_n_u_cp1255) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1256, __pyx_mstate_global->__pyx_n_u_cp1256) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1257, __pyx_mstate_global->__pyx_n_u_cp1257) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win1258, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win866, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win874, __pyx_mstate_global->__pyx_n_u_cp874) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win932, __pyx_mstate_global->__pyx_n_u_cp932) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win936, __pyx_mstate_global->__pyx_n_u_cp936) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win949, __pyx_mstate_global->__pyx_n_u_cp949) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_win950, __pyx_mstate_global->__pyx_n_u_cp950) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1250, __pyx_mstate_global->__pyx_n_u_cp1250) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1251, __pyx_mstate_global->__pyx_n_u_cp1251) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1252, __pyx_mstate_global->__pyx_n_u_cp1252) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1253, __pyx_mstate_global->__pyx_n_u_cp1253) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1254, __pyx_mstate_global->__pyx_n_u_cp1254) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1255, __pyx_mstate_global->__pyx_n_u_cp1255) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1256, __pyx_mstate_global->__pyx_n_u_cp1256) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1257, __pyx_mstate_global->__pyx_n_u_cp1257) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows1258, __pyx_mstate_global->__pyx_n_u_cp1258) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows866, __pyx_mstate_global->__pyx_n_u_cp866) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows874, __pyx_mstate_global->__pyx_n_u_cp874) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows932, __pyx_mstate_global->__pyx_n_u_cp932) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows936, __pyx_mstate_global->__pyx_n_u_cp936) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows949, __pyx_mstate_global->__pyx_n_u_cp949) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_windows950, __pyx_mstate_global->__pyx_n_u_cp950) < (0)) __PYX_ERR(7, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ENCODINGS_MAP, __pyx_t_4) < (0)) __PYX_ERR(7, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":8
 * 
 * 
 * from asyncpg import exceptions             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 8, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(8, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":32
 *         return self._is_utf8
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_3get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_get_text_code, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_get_text_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":35
 *         return self._codec
 * 
 *     cpdef inline register_data_types(self, types):             # <<<<<<<<<<<<<<
 *         self._data_codecs.add_types(types)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_5register_data_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_register_data, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_register_data_types, __pyx_t_4) < (0)) __PYX_ERR(8, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":38
 *         self._data_codecs.add_types(types)
 * 
 *     cpdef inline add_python_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                   typeinfos, typekind, encoder, decoder,
 *                                   format):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_7add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_add_python_co, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":65
 *                                            _format, xformat)
 * 
 *     cpdef inline remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_9remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_remove_python, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":68
 *         self._data_codecs.remove_python_codec(typeoid, typename, typeschema)
 * 
 *     cpdef inline clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._data_codecs.clear_type_cache()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_11clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_clear_type_ca, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_t_4) < (0)) __PYX_ERR(8, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":71
 *         self._data_codecs.clear_type_cache()
 * 
 *     cpdef inline set_builtin_type_codec(self, typeoid, typename, typeschema,             # <<<<<<<<<<<<<<
 *                                         typekind, alias_to, format):
 *         cdef:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_13set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_set_builtin_t, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":92
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,
 *                                       ServerDataFormat format=PG_FORMAT_ANY,             # <<<<<<<<<<<<<<
 *                                       bint ignore_custom_codec=False):
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
*/
  __pyx_mstate_global->__pyx_k_ = __pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY;

  /* "asyncpg/protocol/settings.pyx":91
 *                                                  typekind, alias_to, _format)
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,             # <<<<<<<<<<<<<<
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "asyncpg/protocol/settings.pyx":93
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):             # <<<<<<<<<<<<<<
 *         return self._data_codecs.get_codec(oid, format, ignore_custom_codec)
 * 
*/
  __pyx_t_2 = PyTuple_Pack(2, __pyx_t_4, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/settings.pyx":91
 *                                                  typekind, alias_to, _format)
 * 
 *     cpdef inline Codec get_data_codec(self, uint32_t oid,             # <<<<<<<<<<<<<<
 *                                       ServerDataFormat format=PG_FORMAT_ANY,
 *                                       bint ignore_custom_codec=False):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_15get_data_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings_get_data_code, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_ConnectionSettings, __pyx_mstate_global->__pyx_n_u_get_data_codec, __pyx_t_4) < (0)) __PYX_ERR(8, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings___reduce_cyth, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_18ConnectionSettings_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ConnectionSettings___setstate_cy, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":8
 * 
 * 
 * from collections.abc import Mapping as MappingABC             # <<<<<<<<<<<<<<
 * 
 * import asyncpg
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Mapping};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Mapping};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      switch (__pyx_t_5) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MappingABC, __pyx_t_2) < (0)) __PYX_ERR(1, 8, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":10
 * from collections.abc import Mapping as MappingABC
 * 
 * import asyncpg             # <<<<<<<<<<<<<<
 * from asyncpg import exceptions
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_t_4) < (0)) __PYX_ERR(1, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":11
 * 
 * import asyncpg
 * from asyncpg import exceptions             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(1, 11, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecMap___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_8CodecMap_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CodecMap___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":40
 * 
 * 
 * codec_map = CodecMap()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CodecMap, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 40, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_codec_map, ((PyObject *)__pyx_t_4)) < (0)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Codec___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Codec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Codec___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":517
 *         self._custom_type_codecs = {}
 * 
 *     def add_types(self, types):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec elem_codec
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_3add_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_add_types, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_add_types, __pyx_t_4) < (0)) __PYX_ERR(1, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":647
 *                 self.declare_fallback_codec(oid, name, schema)
 * 
 *     def add_python_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                          typeinfos, encoder, decoder, format, xformat):
 *         cdef:
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_5add_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_add_python_codec, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_add_python_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":692
 *                     typename))
 * 
 *     def remove_python_codec(self, typeoid, typename, typeschema):             # <<<<<<<<<<<<<<
 *         for fmt in (PG_FORMAT_BINARY, PG_FORMAT_TEXT):
 *             self._custom_type_codecs.pop((typeoid, fmt), None)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_7remove_python_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_remove_python_co, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_remove_python_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":698
 * 
 *     def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,
 *                                 alias_to, format=PG_FORMAT_ANY):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__4 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":697
 *         self.clear_type_cache()
 * 
 *     def _set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                 alias_to, format=PG_FORMAT_ANY):
 *         cdef:
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_9_set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig__set_builtin_typ, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec_2, __pyx_t_4) < (0)) __PYX_ERR(1, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":747
 * 
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,
 *                                alias_to, format=PG_FORMAT_ANY):             # <<<<<<<<<<<<<<
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
 *                                      alias_to, format)
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__5 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":746
 *                 f'there is no {codec_str} codec for {alias_to}')
 * 
 *     def set_builtin_type_codec(self, typeoid, typename, typeschema, typekind,             # <<<<<<<<<<<<<<
 *                                alias_to, format=PG_FORMAT_ANY):
 *         self._set_builtin_type_codec(typeoid, typename, typeschema, typekind,
*/
  __pyx_t_4 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(__pyx_e_7asyncpg_8protocol_8protocol_PG_FORMAT_ANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_11set_builtin_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_set_builtin_type, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_set_builtin_type_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 746, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":752
 *         self.clear_type_cache()
 * 
 *     def clear_type_cache(self):             # <<<<<<<<<<<<<<
 *         self._derived_type_codecs.clear()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_13clear_type_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_clear_type_cache, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_clear_type_cache, __pyx_t_4) < (0)) __PYX_ERR(1, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":755
 *         self._derived_type_codecs.clear()
 * 
 *     def declare_fallback_codec(self, uint32_t oid, str name, str schema):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_15declare_fallback_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig_declare_fallback, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_declare_fallback_codec, __pyx_t_4) < (0)) __PYX_ERR(1, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_DataCodecConfig, (type(self), 0xd9a8555, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_DataCodecConfig__set_state(self, __pyx_state)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_15DataCodecConfig_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DataCodecConfig___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_DataCodecConfig, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_4) < (0)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/base.pyx":831
 * cdef inline Codec get_core_codec(
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):             # <<<<<<<<<<<<<<
 *     cdef:
 *         void *ptr = NULL
*/
  __pyx_mstate_global->__pyx_k__7 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT;

  /* "asyncpg/protocol/codecs/base.pyx":850
 * cdef inline Codec get_any_core_codec(
 *         uint32_t oid, ServerDataFormat format,
 *         ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):             # <<<<<<<<<<<<<<
 *     """A version of get_core_codec that accepts PG_FORMAT_ANY."""
 *     cdef:
*/
  __pyx_mstate_global->__pyx_k__8 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT;

  /* "asyncpg/protocol/codecs/base.pyx":876
 *                          decode_func decode,
 *                          ServerDataFormat format,
 *                          ClientExchangeFormat xformat=PG_XFORMAT_OBJECT):             # <<<<<<<<<<<<<<
 * 
 *     if oid > MAXSUPPORTEDOID:
*/
  __pyx_mstate_global->__pyx_k__9 = __pyx_e_7asyncpg_8protocol_8protocol_PG_XFORMAT_OBJECT;

  /* "asyncpg/protocol/codecs/pgproto.pyx":484
 * 
 * 
 * init_all_pgproto_codecs()             # <<<<<<<<<<<<<<
*/
  __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_all_pgproto_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":8
 * 
 * 
 * from collections.abc import (Iterable as IterableABC,             # <<<<<<<<<<<<<<
 *                              Mapping as MappingABC,
 *                              Sized as SizedABC)
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Iterable,__pyx_mstate_global->__pyx_n_u_Mapping,__pyx_mstate_global->__pyx_n_u_Sized};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Iterable,__pyx_mstate_global->__pyx_n_u_Mapping,__pyx_mstate_global->__pyx_n_u_Sized};
    for (__pyx_t_5=0; __pyx_t_5 < 3; __pyx_t_5++) {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      switch (__pyx_t_5) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_IterableABC, __pyx_t_2) < (0)) __PYX_ERR(2, 8, __pyx_L1_error)
        break;
        case 1:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MappingABC, __pyx_t_2) < (0)) __PYX_ERR(2, 9, __pyx_L1_error)
        break;
        case 2:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SizedABC, __pyx_t_2) < (0)) __PYX_ERR(2, 10, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":12
 *                              Sized as SizedABC)
 * 
 * from asyncpg import exceptions             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(2, 12, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/array.pyx":18
 * 
 * # "NULL"
 * cdef Py_UCS4 *APG_NULL = [0x004E, 0x0055, 0x004C, 0x004C, 0x0000]             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_11[0] = 0x004E;
  __pyx_t_11[1] = 0x0055;
  __pyx_t_11[2] = 0x004C;
  __pyx_t_11[3] = 0x004C;
  __pyx_t_11[4] = 0x0000;
  __pyx_v_7asyncpg_8protocol_8protocol_APG_NULL = __pyx_t_11;

  /* "asyncpg/protocol/codecs/array.pyx":875
 *                         PG_FORMAT_BINARY)
 * 
 * init_array_codecs()             # <<<<<<<<<<<<<<
*/
  __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_array_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":8
 * 
 * 
 * from asyncpg import types as apg_types             # <<<<<<<<<<<<<<
 * 
 * from collections.abc import Sequence as SequenceABC
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 8, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      switch (__pyx_t_5) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_apg_types, __pyx_t_2) < (0)) __PYX_ERR(12, 8, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/range.pyx":10
 * from asyncpg import types as apg_types
 * 
 * from collections.abc import Sequence as SequenceABC             # <<<<<<<<<<<<<<
 * 
 * # defined in postgresql/src/include/utils/rangetypes.h
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 10, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Sequence};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 10, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      switch (__pyx_t_5) {
        case 0:
        if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SequenceABC, __pyx_t_2) < (0)) __PYX_ERR(12, 10, __pyx_L1_error)
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":8
 * 
 * 
 * from asyncpg import exceptions             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 8, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_5 = 0; {
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_2) < (0)) __PYX_ERR(13, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/codecs/record.pyx":71
 *                         PG_FORMAT_BINARY)
 * 
 * init_record_codecs()             # <<<<<<<<<<<<<<
*/
  __pyx_t_4 = __pyx_f_7asyncpg_8protocol_8protocol_init_record_codecs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/coreproto.pyx":8
 * 
 * 
 * import hashlib             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hashlib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 8, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hashlib, __pyx_t_4) < (0)) __PYX_ERR(15, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":8
 * 
 * 
 * import base64             # <<<<<<<<<<<<<<
 * import hashlib
 * import hmac
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_base64, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_base64, __pyx_t_4) < (0)) __PYX_ERR(3, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":9
 * 
 * import base64
 * import hashlib             # <<<<<<<<<<<<<<
 * import hmac
 * import re
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hashlib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hashlib, __pyx_t_4) < (0)) __PYX_ERR(3, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":10
 * import base64
 * import hashlib
 * import hmac             # <<<<<<<<<<<<<<
 * import re
 * import secrets
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_hmac, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_hmac, __pyx_t_4) < (0)) __PYX_ERR(3, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":11
 * import hashlib
 * import hmac
 * import re             # <<<<<<<<<<<<<<
 * import secrets
 * import stringprep
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_4) < (0)) __PYX_ERR(3, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":12
 * import hmac
 * import re
 * import secrets             # <<<<<<<<<<<<<<
 * import stringprep
 * import unicodedata
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_secrets, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 12, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_secrets, __pyx_t_4) < (0)) __PYX_ERR(3, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":13
 * import re
 * import secrets
 * import stringprep             # <<<<<<<<<<<<<<
 * import unicodedata
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_stringprep, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_stringprep, __pyx_t_4) < (0)) __PYX_ERR(3, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":14
 * import secrets
 * import stringprep
 * import unicodedata             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_unicodedata, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 14, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_unicodedata, __pyx_t_4) < (0)) __PYX_ERR(3, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":73
 *     to support other channel binding methos in the future
 *     """
 *     AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"]             # <<<<<<<<<<<<<<
 *     DEFAULT_CLIENT_NONCE_BYTES = 24
 *     DIGEST = hashlib.sha256
*/
  __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_kp_b_SCRAM_SHA_256); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_AUTHENTICATION_METHODS, __pyx_t_4) < (0)) __PYX_ERR(3, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "asyncpg/protocol/scram.pyx":74
 *     """
 *     AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"]
 *     DEFAULT_CLIENT_NONCE_BYTES = 24             # <<<<<<<<<<<<<<
 *     DIGEST = hashlib.sha256
 *     REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding',
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_DEFAULT_CLIENT_NONCE_BYTES, __pyx_mstate_global->__pyx_int_24) < (0)) __PYX_ERR(3, 74, __pyx_L1_error)

  /* "asyncpg/protocol/scram.pyx":75
 *     AUTHENTICATION_METHODS = [b"SCRAM-SHA-256"]
 *     DEFAULT_CLIENT_NONCE_BYTES = 24
 *     DIGEST = hashlib.sha256             # <<<<<<<<<<<<<<
 *     REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding',
 *         'server_nonce']
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hashlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sha256); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_DIGEST, __pyx_t_2) < (0)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":76
 *     DEFAULT_CLIENT_NONCE_BYTES = 24
 *     DIGEST = hashlib.sha256
 *     REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding',             # <<<<<<<<<<<<<<
 *         'server_nonce']
 *     REQUIREMENTS_CLIENT_PROOF = ['password_iterations', 'password_salt',
*/
  __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_client_channel_binding, __pyx_mstate_global->__pyx_n_u_server_nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_FINAL_MESSAG, __pyx_t_2) < (0)) __PYX_ERR(3, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":78
 *     REQUIREMENTS_CLIENT_FINAL_MESSAGE = ['client_channel_binding',
 *         'server_nonce']
 *     REQUIREMENTS_CLIENT_PROOF = ['password_iterations', 'password_salt',             # <<<<<<<<<<<<<<
 *         'server_first_message', 'server_nonce']
 *     SASLPREP_PROHIBITED = (
*/
  __pyx_t_2 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_n_u_password_iterations, __pyx_mstate_global->__pyx_n_u_password_salt, __pyx_mstate_global->__pyx_n_u_server_first_message, __pyx_mstate_global->__pyx_n_u_server_nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_REQUIREMENTS_CLIENT_PROOF, __pyx_t_2) < (0)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":81
 *         'server_first_message', 'server_nonce']
 *     SASLPREP_PROHIBITED = (
 *         stringprep.in_table_a1, # PostgreSQL treats this as prohibited             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c12,
 *         stringprep.in_table_c21_c22,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_a1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":82
 *     SASLPREP_PROHIBITED = (
 *         stringprep.in_table_a1, # PostgreSQL treats this as prohibited
 *         stringprep.in_table_c12,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c21_c22,
 *         stringprep.in_table_c3,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c12); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":83
 *         stringprep.in_table_a1, # PostgreSQL treats this as prohibited
 *         stringprep.in_table_c12,
 *         stringprep.in_table_c21_c22,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c3,
 *         stringprep.in_table_c4,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c21_c22); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":84
 *         stringprep.in_table_c12,
 *         stringprep.in_table_c21_c22,
 *         stringprep.in_table_c3,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c4,
 *         stringprep.in_table_c5,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c3); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":85
 *         stringprep.in_table_c21_c22,
 *         stringprep.in_table_c3,
 *         stringprep.in_table_c4,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c5,
 *         stringprep.in_table_c6,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c4); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":86
 *         stringprep.in_table_c3,
 *         stringprep.in_table_c4,
 *         stringprep.in_table_c5,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c6,
 *         stringprep.in_table_c7,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":87
 *         stringprep.in_table_c4,
 *         stringprep.in_table_c5,
 *         stringprep.in_table_c6,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c7,
 *         stringprep.in_table_c8,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c6); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":88
 *         stringprep.in_table_c5,
 *         stringprep.in_table_c6,
 *         stringprep.in_table_c7,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c8,
 *         stringprep.in_table_c9,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c7); if (unlikely(!__pyx_t_16)) __PYX_ERR(3, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":89
 *         stringprep.in_table_c6,
 *         stringprep.in_table_c7,
 *         stringprep.in_table_c8,             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c9,
 *     )
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c8); if (unlikely(!__pyx_t_17)) __PYX_ERR(3, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":90
 *         stringprep.in_table_c7,
 *         stringprep.in_table_c8,
 *         stringprep.in_table_c9,             # <<<<<<<<<<<<<<
 *     )
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stringprep); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_in_table_c9); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/scram.pyx":81
 *         'server_first_message', 'server_nonce']
 *     SASLPREP_PROHIBITED = (
 *         stringprep.in_table_a1, # PostgreSQL treats this as prohibited             # <<<<<<<<<<<<<<
 *         stringprep.in_table_c12,
 *         stringprep.in_table_c21_c22,
*/
  __pyx_t_2 = PyTuple_Pack(10, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_SCRAMAuthentication, __pyx_mstate_global->__pyx_n_u_SASLPREP_PROHIBITED, __pyx_t_2) < (0)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_19SCRAMAuthentication_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SCRAMAuthentication___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":15
 * 
 * AUTH_METHOD_NAME = {
 *     AUTH_REQUIRED_KERBEROS: 'kerberosv5',             # <<<<<<<<<<<<<<
 *     AUTH_REQUIRED_PASSWORD: 'password',
 *     AUTH_REQUIRED_PASSWORDMD5: 'md5',
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_KERBEROS); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_kerberosv5) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "asyncpg/protocol/coreproto.pyx":16
 * AUTH_METHOD_NAME = {
 *     AUTH_REQUIRED_KERBEROS: 'kerberosv5',
 *     AUTH_REQUIRED_PASSWORD: 'password',             # <<<<<<<<<<<<<<
 *     AUTH_REQUIRED_PASSWORDMD5: 'md5',
 *     AUTH_REQUIRED_GSS: 'gss',
*/
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORD); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_password) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "asyncpg/protocol/coreproto.pyx":17
 *     AUTH_REQUIRED_KERBEROS: 'kerberosv5',
 *     AUTH_REQUIRED_PASSWORD: 'password',
 *     AUTH_REQUIRED_PASSWORDMD5: 'md5',             # <<<<<<<<<<<<<<
 *     AUTH_REQUIRED_GSS: 'gss',
 *     AUTH_REQUIRED_SASL: 'scram-sha-256',
*/
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_PASSWORDMD5); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_md5) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "asyncpg/protocol/coreproto.pyx":18
 *     AUTH_REQUIRED_PASSWORD: 'password',
 *     AUTH_REQUIRED_PASSWORDMD5: 'md5',
 *     AUTH_REQUIRED_GSS: 'gss',             # <<<<<<<<<<<<<<
 *     AUTH_REQUIRED_SASL: 'scram-sha-256',
 *     AUTH_REQUIRED_SSPI: 'sspi',
*/
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_GSS); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_gss) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "asyncpg/protocol/coreproto.pyx":19
 *     AUTH_REQUIRED_PASSWORDMD5: 'md5',
 *     AUTH_REQUIRED_GSS: 'gss',
 *     AUTH_REQUIRED_SASL: 'scram-sha-256',             # <<<<<<<<<<<<<<
 *     AUTH_REQUIRED_SSPI: 'sspi',
 * }
*/
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SASL); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_kp_u_scram_sha_256) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "asyncpg/protocol/coreproto.pyx":20
 *     AUTH_REQUIRED_GSS: 'gss',
 *     AUTH_REQUIRED_SASL: 'scram-sha-256',
 *     AUTH_REQUIRED_SSPI: 'sspi',             # <<<<<<<<<<<<<<
 * }
 * 
*/
  __pyx_t_18 = __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(__pyx_e_7asyncpg_8protocol_8protocol_AUTH_REQUIRED_SSPI); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_18, __pyx_mstate_global->__pyx_n_u_sspi) < (0)) __PYX_ERR(15, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AUTH_METHOD_NAME, __pyx_t_2) < (0)) __PYX_ERR(15, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":46
 *         self._reset_result()
 * 
 *     cpdef is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         # PQTRANS_INTRANS = idle, within transaction block
 *         # PQTRANS_INERROR = idle, within failed transaction
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_3is_in_transaction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoreProtocol_is_in_transaction, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_is_in_transaction, __pyx_t_2) < (0)) __PYX_ERR(15, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoreProtocol___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CoreProtocol, (type(self), 0xa7a9ac8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CoreProtocol__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12CoreProtocol_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoreProtocol___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_CoreProtocol, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1232
 * 
 * 
 * SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message())             # <<<<<<<<<<<<<<
 * FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message())
*/
  __pyx_t_18 = NULL;
  __pyx_t_17 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_17)) __PYX_ERR(15, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_16 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_17)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_17)); if (unlikely(!__pyx_t_16)) __PYX_ERR(15, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_16};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SYNC_MESSAGE, __pyx_t_2) < (0)) __PYX_ERR(15, 1232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/coreproto.pyx":1233
 * 
 * SYNC_MESSAGE = bytes(WriteBuffer.new_message(b'S').end_message())
 * FLUSH_MESSAGE = bytes(WriteBuffer.new_message(b'H').end_message())             # <<<<<<<<<<<<<<
*/
  __pyx_t_16 = NULL;
  __pyx_t_18 = ((PyObject *)__pyx_vtabptr_7asyncpg_7pgproto_7pgproto_WriteBuffer->new_message('H')); if (unlikely(!__pyx_t_18)) __PYX_ERR(15, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_17 = ((struct __pyx_vtabstruct_7asyncpg_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_18)->__pyx_vtab)->end_message(((struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *)__pyx_t_18)); if (unlikely(!__pyx_t_17)) __PYX_ERR(15, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 1233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FLUSH_MESSAGE, __pyx_t_2) < (0)) __PYX_ERR(15, 1233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":8
 * 
 * 
 * from asyncpg import exceptions             # <<<<<<<<<<<<<<
 * 
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncpg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 8, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_exceptions};
    __pyx_t_5 = 0; {
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_5]); if (unlikely(!__pyx_t_17)) __PYX_ERR(17, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_5], __pyx_t_17) < (0)) __PYX_ERR(17, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":35
 *         self.ignore_custom_codec = ignore_custom_codec
 * 
 *     def _get_parameters(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_3_get_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__get_para, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_get_parameters, __pyx_t_2) < (0)) __PYX_ERR(17, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":49
 *         return tuple(result)
 * 
 *     def _get_attributes(self):             # <<<<<<<<<<<<<<
 *         cdef Codec codec
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_5_get_attributes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__get_attr, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_get_attributes, __pyx_t_2) < (0)) __PYX_ERR(17, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":73
 *         return tuple(result)
 * 
 *     def _init_types(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Codec codec
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_7_init_types, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__init_typ, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_init_types, __pyx_t_2) < (0)) __PYX_ERR(17, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":92
 *         return missing
 * 
 *     cpdef _init_codecs(self):             # <<<<<<<<<<<<<<
 *         self._ensure_args_encoder()
 *         self._ensure_rows_decoder()
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_9_init_codecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState__init_cod, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_init_codecs, __pyx_t_2) < (0)) __PYX_ERR(17, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":96
 *         self._ensure_rows_decoder()
 * 
 *     def attach(self):             # <<<<<<<<<<<<<<
 *         self.refs += 1
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_11attach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_attach, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_attach, __pyx_t_2) < (0)) __PYX_ERR(17, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":99
 *         self.refs += 1
 * 
 *     def detach(self):             # <<<<<<<<<<<<<<
 *         self.refs -= 1
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_13detach, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_detach, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_detach, __pyx_t_2) < (0)) __PYX_ERR(17, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":102
 *         self.refs -= 1
 * 
 *     def mark_closed(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_15mark_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_mark_clos, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_mark_closed, __pyx_t_2) < (0)) __PYX_ERR(17, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/prepared_stmt.pyx":105
 *         self.closed = True
 * 
 *     def mark_unprepared(self):             # <<<<<<<<<<<<<<
 *         if self.name:
 *             raise exceptions.InternalClientError(
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_17mark_unprepared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState_mark_unpr, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_PreparedStatementState, __pyx_mstate_global->__pyx_n_u_mark_unprepared, __pyx_t_2) < (0)) __PYX_ERR(17, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState___reduce, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_22PreparedStatementState_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PreparedStatementState___setstat, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(9, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":73
 * 
 * 
 * NO_TIMEOUT = object()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_17 = NULL;
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_17, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_object, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NO_TIMEOUT, __pyx_t_2) < (0)) __PYX_ERR(0, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":111
 *             self.create_future = self._create_future_fallback
 * 
 *     def set_connection(self, connection):             # <<<<<<<<<<<<<<
 *         self.conref = weakref.ref(connection)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_3set_connection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_set_connection, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_set_connection, __pyx_t_2) < (0)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":120
 *             return None
 * 
 *     def get_server_pid(self):             # <<<<<<<<<<<<<<
 *         return self.backend_pid
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_5get_server_pid, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_server_pid, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_server_pid, __pyx_t_2) < (0)) __PYX_ERR(0, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":123
 *         return self.backend_pid
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return self.settings
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_7get_settings, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_settings, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_settings, __pyx_t_2) < (0)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":126
 *         return self.settings
 * 
 *     def get_record_class(self):             # <<<<<<<<<<<<<<
 *         return self.record_class
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_9get_record_class, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_get_record_class, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_record_class, __pyx_t_2) < (0)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "asyncpg/protocol/protocol.pyx":141
 *     async def prepare(self, stmt_name, query, timeout,
 *                       *,
 *                       PreparedStatementState state=None,             # <<<<<<<<<<<<<<
 *                       ignore_custom_codec=False,
 *                       record_class):
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_state, Py_None) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)

  /* "asyncpg/protocol/protocol.pyx":142
 *                       *,
 *                       PreparedStatementState state=None,
 *                       ignore_custom_codec=False,             # <<<<<<<<<<<<<<
 *                       record_class):
 *         if self.cancel_waiter is not None:
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ignore_custom_codec, Py_False) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)

  /* "asyncpg/protocol/protocol.pyx":139
 *             self.transport.pause_reading()
 * 
 *     async def prepare(self, stmt_name, query, timeout,             # <<<<<<<<<<<<<<
 *                       *,
 *                       PreparedStatementState state=None,
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_11prepare, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_prepare, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_17, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_prepare, __pyx_t_17) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":167
 *             return await waiter
 * 
 *     async def bind_execute(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/
  __pyx_t_17 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_state, __pyx_mstate_global->__pyx_n_u_PreparedStatementState) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_portal_name, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_limit, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_return_extra, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_14bind_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_17);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind_execute, __pyx_t_2) < (0)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":207
 *             return await waiter
 * 
 *     async def bind_execute_many(             # <<<<<<<<<<<<<<
 *         self,
 *         state: PreparedStatementState,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_state, __pyx_mstate_global->__pyx_n_u_PreparedStatementState) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_portal_name, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return_rows, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_17bind_execute_many, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind_execute_many, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_17, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind_execute_many, __pyx_t_17) < (0)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":268
 *             return await waiter
 * 
 *     async def bind(self, PreparedStatementState state, args,             # <<<<<<<<<<<<<<
 *                    str portal_name, timeout):
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_20bind, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_bind, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_bind, __pyx_t_17) < (0)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":296
 *             return await waiter
 * 
 *     async def execute(self, PreparedStatementState state,             # <<<<<<<<<<<<<<
 *                       str portal_name, int limit, return_extra,
 *                       timeout):
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_23execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_execute, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_execute, __pyx_t_17) < (0)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":325
 *             return await waiter
 * 
 *     async def close_portal(self, str portal_name, timeout):             # <<<<<<<<<<<<<<
 * 
 *         if self.cancel_waiter is not None:
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_26close_portal, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_portal, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close_portal, __pyx_t_17) < (0)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":347
 *             return await waiter
 * 
 *     async def query(self, query, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_29query, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_query, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_query, __pyx_t_17) < (0)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":371
 *             return await waiter
 * 
 *     async def copy_out(self, copy_stmt, sink, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_32copy_out, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_out, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_copy_out, __pyx_t_17) < (0)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":424
 *         return status_msg
 * 
 *     async def copy_in(self, copy_stmt, reader, data,             # <<<<<<<<<<<<<<
 *                       records, PreparedStatementState record_stmt, timeout):
 *         cdef:
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_35copy_in, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_copy_in, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_copy_in, __pyx_t_17) < (0)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":562
 *         return status_msg
 * 
 *     async def close_statement(self, PreparedStatementState state, timeout):             # <<<<<<<<<<<<<<
 *         if self.cancel_waiter is not None:
 *             await self.cancel_waiter
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_38close_statement, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close_statement, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close_statement, __pyx_t_17) < (0)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":587
 *             return await waiter
 * 
 *     def is_closed(self):             # <<<<<<<<<<<<<<
 *         return self.closing
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_41is_closed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_is_closed, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_closed, __pyx_t_17) < (0)) __PYX_ERR(0, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":590
 *         return self.closing
 * 
 *     def is_connected(self):             # <<<<<<<<<<<<<<
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_43is_connected, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_is_connected, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_connected, __pyx_t_17) < (0)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":593
 *         return not self.closing and self.con_status == CONNECTION_OK
 * 
 *     def abort(self):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_45abort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_abort, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_abort, __pyx_t_17) < (0)) __PYX_ERR(0, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":602
 *         self.transport = None
 * 
 *     async def close(self, timeout):             # <<<<<<<<<<<<<<
 *         if self.closing:
 *             return
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_47close, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol_close, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_close, __pyx_t_17) < (0)) __PYX_ERR(0, 602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":642
 *             self.transport.abort()
 * 
 *     def _request_cancel(self):             # <<<<<<<<<<<<<<
 *         self.cancel_waiter = self.create_future()
 *         self.cancel_sent_waiter = self.create_future()
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_50_request_cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__request_cancel, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_request_cancel, __pyx_t_17) < (0)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":669
 *         self._set_state(PROTOCOL_CANCELLED)
 * 
 *     def _on_timeout(self, fut):             # <<<<<<<<<<<<<<
 *         if self.waiter is not fut or fut.done() or \
 *                 self.cancel_waiter is not None or \
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_52_on_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__on_timeout, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_on_timeout, __pyx_t_17) < (0)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":677
 *         self.waiter.set_exception(asyncio.TimeoutError())
 * 
 *     def _on_waiter_completed(self, fut):             # <<<<<<<<<<<<<<
 *         if self.timeout_handle:
 *             self.timeout_handle.cancel()
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_54_on_waiter_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__on_waiter_complete, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_on_waiter_completed, __pyx_t_17) < (0)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":686
 *             self._request_cancel()
 * 
 *     def _create_future_fallback(self):             # <<<<<<<<<<<<<<
 *         return asyncio.Future(loop=self.loop)
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_56_create_future_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__create_future_fall, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_create_future_fallback, __pyx_t_17) < (0)) __PYX_ERR(0, 686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":702
 *         self.settings.add_setting(name, val)
 * 
 *     def _get_timeout(self, timeout):             # <<<<<<<<<<<<<<
 *         if timeout is not None:
 *             try:
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_58_get_timeout, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__get_timeout, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_get_timeout, __pyx_t_17) < (0)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":738
 *                 'cannot perform operation: another operation is in progress')
 * 
 *     def _is_cancelling(self):             # <<<<<<<<<<<<<<
 *         return (
 *             self.cancel_waiter is not None or
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_60_is_cancelling, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol__is_cancelling, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_is_cancelling, __pyx_t_17) < (0)) __PYX_ERR(0, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":744
 *         )
 * 
 *     async def _wait_for_cancellation(self):             # <<<<<<<<<<<<<<
 *         if self.cancel_sent_waiter is not None:
 *             await self.cancel_sent_waiter
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_62_wait_for_cancellation, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_BaseProtocol__wait_for_cancellat, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_wait_for_cancellation, __pyx_t_17) < (0)) __PYX_ERR(0, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":963
 *     # asyncio callbacks:
 * 
 *     def data_received(self, data):             # <<<<<<<<<<<<<<
 *         self.buffer.feed_data(data)
 *         self._read_server_messages()
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_65data_received, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_data_received, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_data_received, __pyx_t_17) < (0)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":967
 *         self._read_server_messages()
 * 
 *     def connection_made(self, transport):             # <<<<<<<<<<<<<<
 *         self.transport = transport
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_67connection_made, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_connection_made, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_connection_made, __pyx_t_17) < (0)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":985
 *             self._on_error(ex)
 * 
 *     def connection_lost(self, exc):             # <<<<<<<<<<<<<<
 *         self.con_status = CONNECTION_BAD
 *         self._set_state(PROTOCOL_FAILED)
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_69connection_lost, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_connection_lost, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_connection_lost, __pyx_t_17) < (0)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":990
 *         self._on_connection_lost(exc)
 * 
 *     def pause_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.clear()
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_71pause_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_pause_writing, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_pause_writing, __pyx_t_17) < (0)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":993
 *         self.writing_allowed.clear()
 * 
 *     def resume_writing(self):             # <<<<<<<<<<<<<<
 *         self.writing_allowed.set()
 * 
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_73resume_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol_resume_writing, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_resume_writing, __pyx_t_17) < (0)) __PYX_ERR(0, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_75__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_17)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_17) < (0)) __PYX_ERR(9, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_BaseProtocol, (type(self), 0x804a80d, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_BaseProtocol__set_state(self, __pyx_state)
*/
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_12BaseProtocol_77__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BaseProtocol___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_17)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_17) < (0)) __PYX_ERR(9, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":1005
 * 
 * 
 * class Timer:             # <<<<<<<<<<<<<<
 *     def __init__(self, budget):
 *         self._budget = budget
*/
  __pyx_t_17 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Timer, __pyx_mstate_global->__pyx_n_u_Timer, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "asyncpg/protocol/protocol.pyx":1006
 * 
 * class Timer:
 *     def __init__(self, budget):             # <<<<<<<<<<<<<<
 *         self._budget = budget
 *         self._started = 0
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Timer___init, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < (0)) __PYX_ERR(0, 1006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1010
 *         self._started = 0
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._started = time.monotonic()
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_3__enter__, 0, __pyx_mstate_global->__pyx_n_u_Timer___enter, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_2) < (0)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1014
 *             self._started = time.monotonic()
 * 
 *     def __exit__(self, et, e, tb):             # <<<<<<<<<<<<<<
 *         if self._budget is not None:
 *             self._budget -= time.monotonic() - self._started
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_5__exit__, 0, __pyx_mstate_global->__pyx_n_u_Timer___exit, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_2) < (0)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1018
 *             self._budget -= time.monotonic() - self._started
 * 
 *     def get_remaining_budget(self):             # <<<<<<<<<<<<<<
 *         return self._budget
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_7get_remaining_budget, 0, __pyx_mstate_global->__pyx_n_u_Timer_get_remaining_budget, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_get_remaining_budget, __pyx_t_2) < (0)) __PYX_ERR(0, 1018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1021
 *         return self._budget
 * 
 *     def has_budget_greater_than(self, amount):             # <<<<<<<<<<<<<<
 *         if self._budget is None:
 *             # Unlimited budget.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5Timer_9has_budget_greater_than, 0, __pyx_mstate_global->__pyx_n_u_Timer_has_budget_greater_than, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_has_budget_greater_than, __pyx_t_2) < (0)) __PYX_ERR(0, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1005
 * 
 * 
 * class Timer:             # <<<<<<<<<<<<<<
 *     def __init__(self, budget):
 *         self._budget = budget
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Timer, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_17, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Timer, __pyx_t_2) < (0)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;

  /* "asyncpg/protocol/protocol.pyx":1029
 * 
 * 
 * class Protocol(BaseProtocol, asyncio.Protocol):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asyncio); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_Protocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7asyncpg_8protocol_8protocol_BaseProtocol), __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_18 = __Pyx_Py3MetaclassPrepare(__pyx_t_16, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_mstate_global->__pyx_n_u_Protocol, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, (PyObject *) NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (__pyx_t_2 != __pyx_t_17) {
    if (unlikely((PyDict_SetItemString(__pyx_t_18, "__orig_bases__", __pyx_t_17) < 0))) __PYX_ERR(0, 1029, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_Py3ClassCreate(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_t_2, __pyx_t_18, NULL, 0, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_17);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Protocol, __pyx_t_17) < (0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1033
 * 
 * 
 * def _create_record(object mapping, tuple elems):             # <<<<<<<<<<<<<<
 *     # Exposed only for testing purposes.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_1_create_record, 0, __pyx_mstate_global->__pyx_n_u_create_record, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_create_record, __pyx_t_2) < (0)) __PYX_ERR(0, 1033, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_DataCodecConfig(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xd9a8555, 0xea6089f, 0x7336a95, b'_custom_type_codecs, _derived_type_codecs')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_3__pyx_unpickle_DataCodecConfig, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_DataCodecConfig, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_5__pyx_unpickle_CoreProtocol, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_CoreProtocol, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_BaseProtocol(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x804a80d, 0x270b831, 0xdd78461, b'_discard_data, _execute_iter, _execute_portal_name, _execute_stmt_name, _is_ssl, _skip_discard, address, backend_pid, backend_secret, buffer, cancel_sent_waiter, cancel_waiter, closing, con_params, con_status, conref, create_future, encoding, gss_ctx, is_reading, last_query, loop, queries_count, record_class, result, result_execute_completed, result_param_desc, result_row_desc, result_status_msg, result_type, return_extra, scram, settings, state, statement, timeout_handle, transport, waiter, writing_paused, xact_status')
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7asyncpg_8protocol_8protocol_7__pyx_unpickle_BaseProtocol, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol, NULL, __pyx_mstate_global->__pyx_n_u_asyncpg_protocol_protocol, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_BaseProtocol, __pyx_t_2) < (0)) __PYX_ERR(9, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "asyncpg/protocol/protocol.pyx":1
 * # Copyright (C) 2016-present the asyncpg authors and contributors             # <<<<<<<<<<<<<<
 * # <see AUTHORS file>
 * #
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init asyncpg.protocol.protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init asyncpg.protocol.protocol");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 581, __pyx_L1_error)
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(2, 379, __pyx_L1_error)
  __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_any); if (!__pyx_builtin_any) __PYX_ERR(3, 132, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(3, 188, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "asyncpg/protocol/codecs/base.pyx":547
 *                 # Canonicalize type name to "elemtype[]"
 *                 if name.startswith('_'):
 *                     name = name[1:]             # <<<<<<<<<<<<<<
 *                 name = '{}[]'.format(name)
 * 
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "asyncpg/protocol/protocol.pyx":248
 * 
 *             while more:
 *                 with timer:             # <<<<<<<<<<<<<<
 *                     await compat.wait_for(
 *                         self.writing_allowed.wait(),
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<1; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_slice;
    for (Py_ssize_t i=0; i<1; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 11; } index[] = {{31},{53},{34},{25},{80},{67},{4},{179},{176},{6},{25},{61},{26},{1},{0},{1},{2},{1},{1},{4},{1},{2},{3},{2},{1},{4},{1},{51},{8},{17},{21},{149},{32},{30},{34},{29},{26},{29},{57},{11},{6},{13},{48},{75},{79},{57},{58},{46},{23},{78},{64},{64},{60},{17},{11},{48},{24},{19},{18},{30},{73},{30},{7},{16},{44},{6},{45},{27},{35},{2},{40},{112},{13},{48},{51},{25},{37},{23},{48},{33},{58},{13},{61},{9},{50},{32},{34},{34},{29},{36},{53},{45},{38},{21},{67},{50},{21},{21},{13},{64},{26},{5},{38},{26},{26},{42},{48},{17},{37},{15},{48},{38},{13},{61},{53},{113},{6},{27},{18},{14},{86},{49},{65},{14},{18},{21},{23},{26},{4},{32},{42},{37},{15},{52},{41},{40},{45},{46},{43},{35},{37},{40},{25},{26},{72},{24},{50},{30},{36},{66},{38},{29},{40},{69},{63},{5},{57},{54},{7},{11},{22},{16},{13},{9},{21},{20},{12},{30},{32},{36},{25},{27},{24},{33},{28},{35},{18},{17},{25},{30},{18},{25},{28},{28},{28},{20},{21},{26},{20},{29},{27},{25},{22},{25},{26},{20},{18},{27},{27},{14},{21},{5},{8},{26},{28},{23},{25},{27},{18},{36},{38},{35},{35},{33},{33},{38},{38},{41},{12},{30},{32},{30},{26},{6},{15},{33},{35},{39},{32},{25},{32},{38},{35},{38},{9},{13},{5},{13},{6},{11},{14},{19},{8},{11},{8},{7},{10},{2},{4},{10},{4},{8},{9},{11},{24},{13},{22},{40},{42},{38},{38},{35},{34},{29},{29},{34},{38},{8},{13},{20},{33},{25},{8},{5},{6},{16},{19},{19},{37},{39},{47},{56},{12},{15},{8},{11},{5},{8},{18},{11},{12},{5},{15},{14},{14},{26},{29},{4},{29},{14},{1},{3},{3},{5},{7},{7},{17},{16},{9},{4},{9},{5},{9},{8},{3},{6},{9},{12},{3},{8},{13},{18},{23},{21},{18},{10},{7},{13},{11},{8},{7},{12},{9},{8},{4},{8},{5},{17},{5},{7},{18},{7},{18},{25},{23},{6},{8},{9},{11},{8},{21},{9},{1},{9},{9},{3},{5},{6},{10},{9},{8},{13},{3},{6},{6},{4},{12},{17},{34},{3},{4},{3},{6},{6},{7},{6},{8},{5},{9},{1},{9},{9},{22},{10},{6},{23},{9},{9},{4},{9},{5},{3},{4},{6},{17},{8},{5},{16},{22},{15},{18},{5},{12},{15},{5},{9},{9},{9},{6},{11},{15},{15},{16},{15},{6},{9},{3},{10},{7},{13},{10},{15},{15},{7},{25},{8},{26},{9},{10},{6},{6},{6},{6},{6},{6},{6},{6},{6},{6},{5},{5},{5},{5},{5},{5},{13},{23},{14},{10},{7},{1},{4},{8},{13},{9},{8},{4},{7},{22},{6},{7},{4},{6},{6},{8},{5},{6},{7},{4},{1},{4},{10},{10},{11},{9},{13},{5},{8},{13},{5},{6},{7},{9},{9},{2},{6},{12},{6},{6},{5},{5},{5},{13},{2},{3},{9},{10},{7},{8},{1},{6},{11},{6},{6},{3},{6},{7},{8},{3},{7},{3},{15},{14},{14},{15},{16},{20},{14},{12},{14},{12},{16},{12},{5},{3},{6},{6},{9},{23},{17},{7},{9},{4},{4},{17},{1},{19},{19},{11},{11},{12},{16},{11},{11},{11},{11},{11},{11},{11},{11},{11},{16},{4},{8},{12},{11},{8},{3},{4},{4},{4},{7},{8},{8},{14},{9},{12},{13},{17},{7},{4},{5},{8},{4},{5},{8},{10},{4},{6},{6},{5},{5},{10},{8},{16},{5},{4},{6},{4},{5},{9},{4},{7},{8},{8},{11},{7},{11},{15},{3},{7},{13},{7},{10},{5},{9},{4},{15},{10},{4},{8},{3},{7},{4},{9},{2},{8},{7},{6},{3},{9},{11},{20},{6},{5},{8},{19},{13},{4},{13},{13},{21},{28},{10},{14},{15},{6},{11},{12},{12},{11},{5},{7},{3},{11},{8},{8},{7},{11},{20},{21},{8},{14},{12},{11},{10},{27},{27},{30},{14},{12},{5},{5},{13},{18},{17},{5},{2},{6},{4},{3},{6},{12},{11},{7},{10},{17},{13},{3},{9},{8},{12},{9},{13},{19},{12},{7},{11},{7},{12},{7},{7},{7},{7},{19},{15},{6},{14},{14},{12},{11},{8},{3},{1},{6},{6},{6},{7},{4},{4},{20},{12},{15},{3},{22},{23},{14},{13},{12},{10},{10},{10},{12},{19},{8},{6},{9},{14},{4},{4},{5},{8},{4},{4},{6},{9},{4},{7},{8},{10},{5},{10},{4},{9},{3},{10},{16},{12},{11},{2},{4},{8},{8},{4},{5},{2},{3},{4},{7},{5},{9},{11},{6},{9},{8},{11},{9},{7},{11},{7},{8},{5},{13},{9},{8},{8},{7},{5},{10},{6},{7},{11},{7},{6},{5},{9},{5},{12},{4},{5},{4},{5},{6},{6},{7},{4},{5},{1},{4},{8},{22},{6},{3},{4},{7},{4},{3},{7},{7},{7},{7},{7},{7},{7},{7},{7},{6},{6},{6},{6},{6},{6},{11},{11},{11},{11},{11},{11},{11},{11},{11},{10},{10},{10},{10},{10},{10},{8},{5},{10},{15},{1},{7},{3},{4},{3},{1},{3},{10},{11},{1717},{13},{10},{2},{1},{1},{4},{0},{2},{3},{10},{2},{8},{8},{11},{2},{34},{258},{18},{29},{52},{67},{77},{152},{70},{29},{24},{30},{88},{111},{75},{12},{12},{804},{38},{96},{21},{9},{9},{15},{16},{12},{13},{18},{122},{28},{140},{113},{12},{258},{9},{21},{25},{18},{26},{17},{2},{9},{11},{793},{1412},{116},{8},{2},{14},{2},{11},{2},{2},{57},{55},{110},{3},{2},{3},{3},{10},{11},{9},{4},{1},{15},{1},{1},{1},{3},{1}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (8545 bytes) */
const char* const cstring = "(\265/\375`\024R\275\n\001\n\004\t7I\000\315\354\374\337\351\177\337\337\337\257\275\357\357\357\367\036\352\270\216J\276\017\001\001\216\3752%\021\231\222\324\020\310O\222M\3077\300{v\313\0171\026M\223\n\000\3033#7\3237 \333\255\315\333-\000\000\270\272.\371q\313:\006\007\003\024\003\251\003'\357\266}\246(\024\neCP\250\033\033\215zm\323&\366\372\334\274\3436\316}c\376=N\344\336P\213!\254 |\337\265\315\252\370\233?\357\315\276T\271\233\337\033\233R\3633=u\017\2279\237\351\316;\337\370\311q;\337\373\365\326\244\211\365\256\264\367f2\275\027\333\266Nk\272\377\217\355\3265\313\367Ns\035\2376\327\360\336+6lQ7(\257O\323\314&>c\371{m\226^\177\214oy_\370)\377 \037\276\215S2\367l\210\t\023\330\342\217\313^.\267V\261\345nk]^\370\344\326\021\354\306\340y\317/\331\24776\266\334i6\323\222\237V\243\267\315\343;\267\323o\246\344-\333\221\224\r\311\260\323\322k2\345\245\327\245\n\217\367{b2r\001\343\374\005M\306\2141\225\314g\323=\375x\337\264\337\365\374M\354\363\366?\337J3\345d\251O\3341nC\231M\215m\020\354\006\010\331,5\004\034\351At~\037+\326,&\363z\321d#\306\030\254b\275\276\345\236o\370\264$\357\336w\025n\317\236Qm\375m\343n\177/\177\253\"\002A\347\007!\203]9\331\225\025\3537p\223\324&\266\244\317\337W\363\365\257k\271\274$\206\276\363%-\317\247&\3513M\234\376\364\274\244\377\347\367\267\314\035\243\271\367|(\256a\360$\006\024\003\206\034I\352\033>1\210\324R\334\327\267\354q6_V\304wl\232\331W\343V\367l\313\335\342\254\311I\376y\177\211\334Pr\373\270i\353y\307-\356\337v6\255\017\367\216}%\316\335\304\371\226%\006\371\350\371g\263\206{\216\366\026\203\334\330\350\374<\210\210X\025\t(\235\037\n\303\007\033\"\242q\307\274\336Y_\317D~\212n\355S~\37267\321S[\3533/-\014L\226\373\355{\376R\311\246\345\251\211wv\325\222\371\260\"1\031Y\214\246\262\254\330\010\243\352\334\316\260Z\",+\246\2629gs\235\363l\205\n\32645/D\306\242\301\214\"X.1V\314\312\206\260f\343\352E\213\261d\256\226\r\231\251X0,Y\366\371\304\035\243\326\212do\342\226\274\353\272\264\250\373\371\336\030U\346\274m\312}""\326\326\262\"\336\324i\315\233d\315\343\344^\222Rr\341\305z\331\335u\377\371\343\236k\332\304}\037\306qW\336\334\345I\373jax\251f\266s[\347(\232z\35337\267^[Lj\334O\261m\275d2\014\255\327(\223\271\210`\322\362\357S[f\324\367m\376\332s\364\374\232\324\346\306\266c\323\366\\j\337A\247\237~\326\337\266\376?\3136\327{w\310\235\223\367\314f\266:\277\225RsK\346\222\2538\210\370\277\363\231\336:\2666\256M\3571\372\375\326\370\206\255\257\333\214\3736Gf\234\312~~\263!\231\3349\325eo\261-\363'3\332\313V\245\334\232%[\373o\3238\214\373(\317\221\374\336rgo3\263\367\337g\357;61\351\313\354\273\347\361\276{\372O\223g\222\337\270\267\365\2627s\257\2318\325\355\262\231#u\316\246\357\275\367\242(\277\371\314\2559\3729\316\243x\373[\356\273#Org4\233e\311\267>}g\352\271Y\353\350E1\312K\315I3\335~\363r\326\235\367\316O\362s_\336\327\244<\317\334\275)\267\354\315\236yh\232\343\334\324f\276\341\364\266\261\271\353\276\326si\332o\212\346\271\234\311.\207\253m\356q\274\327&\336\335\362\377\377\347\255O|{\271L\225\032RPNLJHR##)\262\226\302\367\353\232\306\361\357\323}\323\372\304\375\255q\275\214\303u\376\311\274\363\377V\323\246\3677\364\336O\356\324\377\323\226R\302+m>S\237\330f\353\345\236o\267]\317\241%\0312\214\\\257q6y\3114\377\354\373\350\231\363%\371\367\371\246\313\362^S\233\370\324\271$I\r%'#$\032PNNRFLRPNLJHFR\031LFR(\331\317\357;\340\262vbO\232\276\1774\223y\357\335\321\364\232d\327d/5y/y\366\236^\363^\222c\217\326z\274fr^\373\272V\376\255o\272vKN\364\335\271\344\244V\273\327\243Y\304\347\255E\270\326\232\364\327\326=\256]\362\206n\276q\357>\276\377N\371\211\277\211\371'\265Ib_\303d\r\353\213\257\211U={\032\316-\264{=\306\225[\177\335\3133\232\021\345_&S\271hx\327\334\275\20371\311M\016\"\235\367\356\2125k\261\264@\274X\261W\347\037]\305^T#\013\014\214L\254E\006ft\265Zd1\254X\213\006c\305l9\346\272=_.\365\326^\205OYY\376T\346\223z\225\313.\243?\277e\327,\237\3305\243\311\260bZ.\325K\213kt\251XL\2743\211\377n\275T\263+3\223\211\275^\255\026\226\213\214\006\323\362w\336\261d.""\256\326JF\345b\335\264m\257f2\226Kk%c\315hX.K\345\222q\335\026\214\352\316`hc\013\013\373\215{\277y\307\317\214#o\307\331$\321\357u\217\365\271\313g\276Bq\214\312'S\225Y\345O^\212\321R\243\367\356t\336\372\372\320\\\342\363\232\370\336[v^\303\367r\362n~\275\276?\337r$\256\365\364\247\266\334\311\237\375\275\244H\366\3705\306\\Wk\006\323\242\261\214\255\221\0253\272\356J\006\304\214\025s]2\255\331\250j\315\\,\0203\332(c\275hf\227f\214\305\306\021-\027\355\266\2146\256Mo\352\236r\301\366\261-\3639Z\030\331(\333\251\356\330,w\232\3264\356\337\253dS\343\372\367\345\316\036\006\206\346\362\245\211O\213\323\371\201\334p\316\375\177\224\035=s\272\212\016\357gu|?\033\242\343\177:\275\037\312\t\312\010IM\227\037\343x6\243\272\261!\024Y!0(\246T\216\325\000\016(\0018@@\212J@@\021\246\2060\004\250>\223\211'G\250\203\246[\013\237nk\201\025\245\322\200\005@\324\242\t8\340D\010\262\242\340AL\t\r\010Y\026N.\0241xFC\nBZ\360c\330\"L1V\350x\\`\303\021\302\035\214\207\225\3429\361\260,\240@\204\255#k\004\341Kp\344I\361\250V`\301\013\tzp0\344\024\013\236\340H\005]B\202\004\202\010\326\034\030\317\310\263b\360A\304Q\035 \210p\300cT\263b5\0040\302\n\214\025 \020\244H V\320\2010q\010\246\254\"\324\006\010\212\trLA\220\036,\204\t\031\324V\032\014\236\017\"DXp$h\001\001\207\tD\217\365\264\222\352\006\335\320C\0101\025T\260\316\324\006\035=\260\031u\007<\320Q\242.\360\370y\230NjFO*c\202\t\330S\253\325\001c\300\0020\340\210i\210\022zX\263\nSU\200\037\302\t\3302\200E\313j\002\001\342\327\t\005\004u+\312\026\013xx\020(bLP\025t( \240\3538\251(\300\024\013E\230\320\304B\021\017C\0105\244\204$\001`<*\303\r\251\n\303\004\031\022\020cv\000x\024M+P<,*\240\007\200\"\006\032 \245\204?\030\013F\010\222\326\225ZR5Nk\306\352\363aa\203 j5\255\035\200.\014V\325*\301\203\250\013N\010\242\2542@\017\231\254\354\2450\236\020\317\201!K8\023\014\321\324\006kjU\240&@\0055`\225\007,\3519\361\230xPC\025\217\242%\342\000\r\2502\340\316$\304\020>X7N#\320\003\310\002\232F=) \001\340\327\355\010\010\232\254\247\225\244""\256N\302\021\220\3428\004!\264\005\013|t\020M\000.:X\340!l\010@\330Q<\rU\010\000\270(\2618\001}i\343B\304b\2658;$C\215\341\203\340l\215\260~\250\345i\205P\304+O\025\000\354PcF\325&\002|\001\200\241\302\354`\01030 \nGa\311\003\"\006\260\352RA\031\265\002p@\251\347\243\"01\350 \201<\335N\tF\007\261#\245*0\251\0100\324\003@\323\032Za\200\036\035E\235\252Rur\2028\230\242\3074\314\005aA\225\365\253\017:\212\243J@\315\331\021P*b`\210\235\322\250g\034V\020\232\204\263\340\005\004D\004\245\036\274\302V\000*\202R\021c\305\001\302\200*:\340\201R\217)\010r\200x\240T\204\001#\000Qv8F=\353\251T4\0051\202+*\003\000\027#\026#)\230\332@\027\3040\2418\362\224\2068A\232u\\%\224\210\245Q1\225\2418\252\030wL\302\223\340)X\001T\304Pa\241B\261\204\244\347\264\203yB\014SC\005\302\324\352!\004\304BI\342cE\207\254\220\030\027\027\027!\027\020 \310F\020\262\013\265n\313%\337\245i>K\3553/F\376\305\355\231\234\373\213{=\276\000\211\265|\226\031\020\357o\005kCn(\312E\271i\377\376\243\202\214\357uA\002\320\202D\363\222Q\271\274|\371\305\242:\307g\236\275\224^\357\372\234\202rbRB2\222*QRPNLJHFR[\363r\307\231\307\363\230\307\343;\274\363\245N\323\224\333S4\315h\252w\252\271/u\357{\377w\316\361\317\177N\371q\377\367\356\035I\241\230\354\035\371k?\337:\352S\177M]\277\235\336\233>\027\335\244<\317\\\222;\037r\023R\302\346c\245\257\364\220\0254de\207\204l\034$\t\346\001&5\001\006\222\320vB;#\020^I\314\035\t:+\007\032\250\247b\024\032W\354a\212\236\312\001T\224\305\210.\236\325\010\321$L\215N|\254\036\200\004@\305\030\214\230\343\3310\344\020f\260DP\017\306i\347\024<`\240\330!\240h\240@O\207\000\223z\032\222t=x\005\217\347e8\003\022f\300&\210&h\2104*\342\037\252\206\251PC\230a\0011\025\374+\252t\226L\263\224s\351\346\246DCS\022!\242\004\203\225J!8R\244\340\370\3758z=\016\3579L\223\203\004\t\216\021#8h4\216\327\213\243\325\"\241@A\312\311!\361x\244\336I\271\034\tc\322\315\r\251\246\206D\243\221\\.\222\213\013I\245\"}\370\360\377\006\306\03377\03355\0334\332\206\3135\322\321\031\371|\243\335n\244\323""\215ppd\262\321\3535zy\031\255V\032'Nh\364z\032i\252\201\24266\0323322\032 @\220\344\314\214\350\365\022}\370\360\177\010\007'd\263\205H\022\004\210\320j\025\032\3074\005\235'Hk\220\315\006\302\330\345\002\271\200@,\246\371\301\341>9\323\320p\314p\210\020\301\021\213qp\214$\035\035\322\377$\024%\221J\022\311\004\211$C\"\275l\244H\261\361\373mx\277\301\371FYn\2300\2611b\304\306l\266\261\301\332\330\030G\336\2178\037\331\330\214ffF,\326h4j\234\247\206\326\032.\227F\210\020\032\343(\322\321\021\355-\302\301\021\325\324\210D\210xy\311\311\t\235gH\353\320\275!\033\233\320\353\025\202\201\001\2358Q\242\004\250\246\006\024\023\003j\265~\277O.\367\271\335>\261\330\307\345B\321\014\323\254\251\3018\361\343\021y=\251\025.(\001D\235\006Mc6\323\210\211\321\320`\021\241@!\372\375D\273\035\016'*K\021\306\"\022$D4\232H\304\022B\201\"\364\373\205v\273\020\347\241\022%B55\241\231\231P,\026zy\001\365z\240\377A:\035\3104A9\203nn@44 \021\"@0\030(D\010\3208~tt>99{\177\312\362c\302\304\347\346\3463b\004\213\365\031\307\014\024(2|\276\214\3363pp2l\266\014\222\234\231\311p\2712B\204\310pq\371\345\330\210\266\032\261v\211\267\206X##\312V\210\036CRX@\210\nzP?p\300\210\005\234\331\331\251\320\000\205\250-@PQ\204\2128\027\345r\242{E66\"\231L$##\022\271\210D\252P\232\206t\272\320\315M\210\206&\344\342\022\n\251@\234\203r9\320\353\005\202\201\001\251@\252O\212\024\2374\375\350t\037\233\355S\253}h\264\017\014\366Y\255>\037>\0372x\274\014\3573j\265\214\022%2^\257\014\030\230\014\226\014\026\014\024\027\027,tN\342\251\211zF\234\275\210/\r\304\231\320\304D\234\355\004\010a\330\200\026vH\260U\267\226\334\362\206\211\004\"\250\303$\270\362\301C\321C\007\225\260\004J\025Xq\343i1\021\222\240\212\033\302\014(S\030\"\230\256\005`\016\nX\217b\002\2320$\324\340\201\275T\205`\202\005\017\254\006\006\212\200&\000)uAG\001b\010$\200\330\201M+\006`\271\023@\270W\t\272\240\203\020\346\261!\261b\235\324\334\265\245\202T\004\035\0360\325\001\200\223\352\"\215X\r\220RE\004\211\311\250d\220\352C\254\030V\314\310\014""\004\022\000\000cr\030T&\025\010\205\343iX\037\344\006\323\r\3473R\264\001!\022\203\006)\002\215\300\000H\000\202\000\000\000\002\000\242\354\352\367\267\\\362c0K\010V\264\363\017\027\016\305\tD]\200\226\020\253\217\2016\r\340|7\235\264\366\374\210\031\303\307\036\237$\375J\373\345f\364\272t\266\315\361\027\307\036\320\247~\261\355[%\333\347\022\252\307\242,\020\311x{\372\007\272\342\352\205\233P\224LW\023\370\327\251\230~\376=K0\231q\234sGT\357\361\355\257\0173\354\214\014\223\266V\253 \217@\027\002\220F\366\246\017\036]\233\247\032J\212\363\024\303\207n`~\203#\3416\ryE\205\0024\226\263=>\341\264\203\275\261q\206c\037\004\314tX\214 \265V\231\374b\261\001\311\314=5\020\344m\244\260\245\364\375\377Jot<\033\037w\n\225\207=\325\020\030Z\023\374\357\306\360\034\310a\352Ca.\237Z\220H\374k6[)\003\370\314\302\336\307z\207,\210a\023\373~L\302\264\326\374b\261\3351\310\323\032<\356s\273*\272a4\0167$\t\206m\216No\374\265dw\323J\362~\213\303\244\261/`\203\326\300\210\341\317\373\244\217h\251\207\223\274\002\234v\246\2362t\306\371b\204\214\205\3359\236\036\325C\267Y\231l\372#p\345\n\021 4\251J\300\002o+\034\013\234\223\222\324\207\231\300\212\263\356\344\314.l\370\266ZA\244+7\205\244\351}\313\225K\312\227\233\316\371\276d\020\351l\006\211\013\034\224\220\276\2221HMMC\306\\D\313b=/\354w\274\320\333\014\276\033\027J\317\246x\254\033\366\241\000\3026qce\226\251\201C\251!-P^,\262\031O\205t\362\033)\010\367\2437K\360\257t%\340\336\210N\341.\254\357aF\225\317\246\335\010\210\277I\020\t\373\206\220\002\232^\274\207#[I\017v\261.>\334 \016\216\346\263\271Kes7 \014\313V\321\010\r\240\232\024=\021p#\345}\260\371\302\250U{;\016r\210\210G|\262\304i>\263\263\\\300<A\241?c\006cW\327\246\275\264\037\342$\206Z*\361\252\303\3179n\304\245l\032\362\rG\216O\356\314]\246\214\036R\227\276h\260\002\017\230e\006_\343\372\207W\005\237\001|w\342@\324GX\322\261^\2542'\0343\232\002\240g\3649|$\r\210\302\312\301.\313K\340M\345\315\265S=\272\020:\225;\253\274\3506d[E7\235\022Sl\032O\200P\025(\2109Q\355\240""\375\t\026\265\n~W\353\355\334\302\271\363\317kO\212\202\004/E\231\220|D\371\010\373<\344`\035\216-\rF:\220=\354\230\213K5r\"\327\377\255\235\n\324\375\0336J\3606A9K{\303\376\341\216\204$1\352\271\\\211\235\0054\325\345{\035\014\240\213\302\nnnn\221\020\021\\F\370%9\376\254\005p^\204}\304\342\nY!7=\276\235\307\342~\3035\265\335\244\203\262\265\274T0\021\234J\337\221\3575+\271\210s\362\t\353\373\212]7\277\300wwj\237\363\001uM\373\311\256\177\027=\323\324\336PLs\275\246\330\321\231\313\226\3252'\313J3,]\260\306l\021\031\272\260\272\020\003\345!a\2735\034V\234\302\002\321\002[\255r\177\222\001W\222(w\365\222Y\000%\326\023Gi\361~\007>\002\205\277\270\337\250\236\217\205P\211z\322OL\202\234e\214\\J\216\027\2456\342{\022\304q;\242\223\342\002\224\034\313$\344\030u|\302\247AL\220\014\231\237O`\230\3214\210\361\"\000\303\235\332\266\020\036\202K\317\315s\343,\215H\351\332\016P\312j\311\371%<\355]\332\231@\244I \306@\034\354\023Q`\337I\270\217\274W\205\345\354\367\312%\027\343\010'PvM\006m\241\230\321!\330(\351:\200\213\226\\\255\022\r7\365\216V\331^\016\027G(\037\347\315\220Q\366\246$\247\326\366\265\211V\360D\263\276\317\372Wr\253\004'\246\017\325D\225\340\010)\361.\r\177\317\016\024\026hW\200\225)i\202\034\021\277\022\"\233\232\027\301\032\342_\271\233\304\372Q\372>\327\305\033Ti\256\214\214)\347w$\331B@\217v\033\257\377\203\313\177\207\275\030\032\0075\376\003\214\320[\3167\032\326tp\013\275\320\357\354\245a\206\013\322-\177\367\356\360}NoT8\035\r*\311\351u\026)\237\342l7\033\200C\036N'\356s\273\226\367\272z\360\001\234\202\346vk\263\216\360\340\017\251l/\375\231\202x3\"\303@\355\227\000t\3208\363\206\344\362\376\351\217HP;,\3020\336\227\266~\340\343P\371;*\240'{Im!\373\353\214\027\265\343\232\245\355V\241t\335\t\023H8\033\253palf\003d_\250\177\003\267\267\270f\006M\350\231c'\220\327[\030 Y\n-S\217\302\303B\010\237\304Bn\304DkqRp\357d\327\013\017\377\177\366|D\201\317\246\220\002h\016\227\352\0009\220k\215\317\220>\311\010ks.)Xq\331\032\266Fg\234w`f#A\255\344jK\234\325=<""!<\365\003\275\275\251\013\001Y\337(\230Q\025k3&QIe\3245 Yn\335\241\337\033a\273\305\0031\204p\325\266\327\314\023\262\201!\344#\341\203\n\216\n\272\306\007\250\222\241\253m\017\243&\t\030\225S\237\350^6\236Q}\330\355=#ko\253@\034u\213\310\362\325H\022\300v_\371\342p\344^2\343\3306g\363T\235\300\"R\300&.\253\354\375\025\354\343I\323f\224a\235\364\026\2344\276\220\221\237\240\320-\013|\222Z\337\317\372\250vDU\030\223\027\241\243\237\356H\025\315s\010\306\300\031\234\335\010\027%n#B\004\261@2.s\360aI\351\352e\215\353\262\036\336\274_\350\3400Wh\343_\3035\242^H\202\010\312EQ\363\374\t\307\210\245\346\220\004,u\364\356\024&\000\302\240\344?9)\rS\313\224\203}\272\273\317Qy\201\227O\322\022&yO\234\001}\302\201\022\021\361\277h\013KOJUZ\367>V\303\217\037\3534\355\211\274\312\200l\333\363\335F\354\3271s\363\314\357\021T\253\003>\030\344\357G\217\377\325\233\367iQ\331\204\020\214\325B\217^\317\230\242U\300\270X\331\355\334\240\377\223%B\204\353L\231\207xy\215\\\255\317\263#\361\246PR\217\023\303\301\364\261\003!\302\224\357\311\202\302\337\212CL\224>\206\353\216\204$O\303\343\207\243Y\34644\332\275-\246\342~AEfv\367\375\002E\256\024\233Z\036D\331\240w\330T\236\2522\341\230\266\023\n\001\231\206\322?\324\025\241Ul\036\240\261r\024\264\270d\026=\200\372 SxbgH\247\0338k\210\247\235_J\262\233\3648\002\322\357\213\343\307\334\311\210\372p\214v\274\\\334x\223^\310\331\253\276\252\272\315\367\214Z\024\270\374\344W\245\225\354\203\033\030\261e\376\323\232y\273{I\0362\036\032\222\376\010\013\347r3\326\262\344*{\332\017\370\203h\032\023=|\272\250g\210M\240\367\257\334\312\352\256\232\024\0234-!l\3220\250\300\226\232\325(\200/\026x\351\272\0300\032\017o\346\340\2530\021\303\376\243\023\217\203\263)\373\r&\200\325\273;(\262\306:\302Q\304je\026\014\353\246\004\023\251\307\214~\241\337\202*\372<\306\t\312\273\350\245x\017gg\016*zS\031TX\n\307\325@)\002\376\213\203L\226\302\375\262\304!\276\303F\010\020\206\264\311\312X\301(#`N\224}\205H\"\220\376{q\016\373\214\336?CuW\302\330}N\244&\367""\2456q\253\341+\225\013\0379\335\275\0379\027@&:G|\254\334,\033\030\356\263\377U\276\243\206\014+\373\016\362T4\311\3156\246\367\217G\034op\335\177%u\372/\364u\000R\023GRr\321\361:\002\020\250\220\374Ng\326\317>\035rb\031\000*)\250\204@\2265\244\244i\337\215\344\021\005z\354\301\034h\357\227\023s\336s:.\373\363\315\205D\265\217\345\tK\346zz\253\250\230\005\000\021\035V\363\344(\325\023\n\335\327R\217\307\021\201K\333\252yt\3258Jd\274\376\035v\241\031\350\274\256\263\340X:\"\232\214Jt\243\014\330G\351\236\324\350P\225a\335U:\357\224J;\226\253\241Q\023p\316\226\212\210\216\324\024\177\202\242\326!\202\3071-\200\347\032\303\325Z`g\305+c\213c!(\317\2502\242\302\0209\263%\252I)\037\366\273j\240h\016!*\302\373*\356\273\2266\307\323\273X\2115\356\230\305Y\020\331@\002J\326\251\315;C\221*\221XO\243c\034\206\346(\230\017\265\314\311\260\375\215 \206r#\021\216\201\307\253(\203Ng^\325\004|\200\235\330\223\227\251%\004#\267.\256.l\"H nFD\331\354\205\372m'c\304(\326\022*\022\343\275\300\3145\253I\270\004}\266\005\001\374\341\335\264*5\220\332\215\2617\330\352\247\035\214\244\017,\342~2\231\007\246\235\352\360\341\346X\223[k\314\223\347\316\025U\240\235#Nd\200xr\227\030\306~\224\213<\305\031\003\t~?\250\261\037,\235\364\0240?\360\200\265+\243\r_@\332\217\351\340\300JNxyH\323\010\344\273\315Z{eE\327\275\305E\017\0048\016\251X\372\230\344\306\265\210\305\325\344=}%0\277\363\236t\203Z\377\2534\364\204~\242\262\202\253|\033\020\367\025J\261\263k\205T\235\035\360I\254R\262\273O\377\027\n\374q\277\307S\330\037j\014\215\317\\\203*\263\275\301c\240aqY\r\302\n\376\205\ncN\232\255\321\336\356\262Sv2\277\214\326\314\254\211W\205\343\326\273\320`\252r\242\277\304\363\014\373\206\026\305\244\257ot}\377=\006;\035\345\356\3532\317\2314\320g?\202\010\023\300\304\0351d\352\0302\r\275n\206\225\217\364U\000T\222\315\224o\305\225`\025\216\337\016\263;\351\020\353\200\371-\373\370\215\253\002\227\253\374UZ\236\3073G\374a\253\234\013\240r\364\000X^\251\337\217\266\267\350\255\313\270\363\340\300\376PC""g\236\023\351WI\2650\343\370)\221\224\2401\364N(\356\035y\323Vy\226&K\016\245\273\213J)kr\036\364\342\030m@\005\030\350v[\301Q\272\337\350A\001\265rr\227\200\251(\006\376=\300!t\253w\037\311>or\2774\217\221\336\037\241\247q\375\357Y\247$\002\327<'\005\350r\354\000\230U9]\234=9gvE\201\240\3166\256}y\377\321r\021E\023\322h\232\010\374\222$&\311w\2301E6\216\367H\334\267\014\235\304\003\327\352RQ\016(\345\200\3115%\372\345\356c\210\240\016\366\201\021\000\n5\232v\217\223\246\363\356z\000\001\365\351c\310\317s%R\223 m@\365\220\301wE\177<\017\244\356\267\006]\361\201\300\225\0033]\017Go\205\225\350\017x\033c\222\353\306P\362\307vV\305\221~\023\326D4\3743\3032\013\203\2572\002Y\n\301E)YYsT\024\231m\222\251\246\211>#a\026\370\343P\032\342\216b:\313G3L\273u\032\337\206I*9\006\356\266\354\235=\204WKE4D6\374\362\033\262\375`\377Z\354Rqr\031\377=W\317sm\315\"\245)\241Cs\321\316\345%<\202\n\217\034\020\276\026IU\267@\325\301\037pb\363\360<\207\254\004\320\2300\030\307\336\303@Z\241;\000\000\002w\004\0140C\323&_,\304\247(5\255\306\367\376C#H\3606B\026\325\035b\273\310g\336s \375\201\017o\226\230\001q\351\232\3252\235\2149\346\3526\\'t-T\226\2269\016%\266\372\003\223,\356\243\004\271<nBj\222k\376\031\345u\332\305~\202\336\247\260z`om5\352\356:\335\205\005\316.\333 \031\215\200\001%\013\252\264\260\364M`\307\010\r\377\251\367\247\027f\032\266\212\002|\032\315\305\330\\g\277\354\364\357\260\215\315>{\342\352\03765\006-C\312\240\311\266\234\366\340^\210\267#\004\177\245-\017\277D\326K\3633\376@CD\\T\313\235\020\275\244qy\005Kqa\343\326\306\255\377aU\351Z@\267\221\022\305\307\310wEH\324\202\335\316\007\225\\\365\nQ\216V+\325\317\\\307\207\271\2200(\232\322\377\306Q\\0\036H\264\212Y\000l \315\372\311\264\214\016\024E\235\332\260\360m}\344\353\201\020:\032\234!\013\006\337\214b\352\230\000\303\263\021\231\004\234W\002\213\036\226#\033[5\026\016\334\246eW\023U\243\222M+\305>>\244}\215\355\327\031\213\360\336!/@\261/>\033\236\236\240\211\372\271\242.\3325\336\253\330\232\226\002D\264\224""\200(\316(\032\306i\263]\241E\n\244\235\\\242\202W\201\225\230\007\236c[`\370u\034M\331\031\2763\261\257\002\337\270\227_\221\321[\321\272or/\022C\2137-\261LL\371J\274\270+\334\t\300>\354\221o\353&`\013\017\202Q\214Z/\205W\t\204\203\2248\376{G\213f\352!\307W\326\226\323x\033\021e\\\305vb\3760\356\206\036\255\304\357\006\236\"\210\266\276\316\314.\307i\321\013|r\242u`\345t\024\212^M7\000'8\020NA\360\020>,\25749\315\370^\356\273\031~LT\000OqV9@\314!l(C\035\371A\017\235\250!y\022\022\357Pg\205\225Rq^\350H\370\211\254\321k\226PK/a\202qt\212GsD\207\tm\375\325\216\236\341f\346\317\367\362J/\0140A|@\"\004\211\234\250'\365\016\352\344ix\243\253\034\222CDW\246+\002p_\213|\345\362\005\207\243\033S\037\262b!\\g\250\354]U@\234<E\274\307\n\211i\025[\013\342\271\"e\314'%SF%\025\227\252\031D\n\361:\326\023\031R$R\036Ne0\214\275\317\231J\024y\353%\245^\001\3723\306\244\337L\331\341D*P\215u\237(\213p\016\345\370u\274\2345\031\250(\223\007\236\022\325v\374\331\006v\334\352/\315U\316v\232q5\301c`\035\006\263\300\210\264o\353\341PL\322\023^\257s\370\003c\371O\217\370\016\247\251s\227\355\037O\242m\245\234P\201w%\337'\005\334\377\017P\375!\0139\206\031\270\253J\202\250\240OSHG)it=~\241\201&\230\2334\226\346\244\317=U\337h\"\350\274z\234\204\026\016-\026\264\322\"\206\025\347\350\335\302\261\331J\322$\274Xb_\262d+_\270\313\356\246\023SG0j\254\217&\364\204.\344\313\376tf\354\215\357\355\307\374=\342\345\002`\324J\241\004/\356\026\220)`\225%\356b3sp?c\361{\232\202\203\376\3660\326\0100s\313\301EJ\316\252=?d\n\330\365\013\253\2350\205<\034\224k<\324\204y\266\317T\007\020\203\2236D\303!p\353\227dM\277\005\361i\350\232\273\330\350\023\036\007\215\254\333\356{\023\275\354z\3711\203\372\343\273\265\006\247\275\314\367K\233K#\027\314\234\021\220!\245T\340\220\345\016i\233\244\226\253\207\023)\240\203\262U\030\345\242\361\241\272\023\332TUkg\001\030\241\373\036\344\260\323\2009QF_K_\317\014W\361RB\216{\331\251-\317q^\227\010\235\321A\023\n\003\207\0340\232\365\251*0\233\036}L_\"\3469\222!{\266T""\247Q\306\252}\341N\364\367\323\034\336\n\324\007\251\376*\215\2668\030\366\352\210\333\361p\314\206\234\370-\020\356\n\320I\375n\"]NtX\332AJ\341\277I\"\002JY\240}A\000=IH\272\024\370<\202\377^\220\327\027\220r}3\213\332\233\0206\217\000\332\237\357\271\253\263\367\213\312\330\211\340\302\206\234\225\225\032n\360\326;\211\212\325P\300\302\004$\356<`\267\211\221jn\234n1\021\245J\276!Rs\220\014hXo:$\334$a\335H@t\032$E\251\365\246\021\304\371b\265\370\265(2i\035\311\244\371\205\213\022\364Pi\nL\372\304RS\262\200r; g1\371\365=\374E\035Q\211\311\177F(\237{\202\364\331\331\301\222e\306H\302\031\374\026#\027v\002\253t:\034j#\217\263pD\033_[\014\202 \021\342`\212\317\333\002)\204B)^\347\243\367\265\254\374g\232\223z\027i\3109\201qz:M\n\276\274\311PK\000\235$\014\030\377\200&\324\026\300\031\263~\010&\314\003O\002-\315C\317\333\264h\261\267)\223T\312)\346\264\212\250\221\274\355\373\325\253\232'\360~\360=\237\007We\303\343/\222^\333\225Y\226\306\277w\316\206s|\334\216\226g'G\005\226\343\244~\021\225\252\256\330\037[\326K^\335\201\026Hb\347G\215\302\037z\262\022U\025\010\330\237\312L\201a\226ia\216-~\325\033\362\265 h\237\217@(\200\316v\0147\037\363\254\005\224){/G\242:\324W\365\010\272+R9\212\311\0106\322\261\r\364I\357/\320B\226\205\316\236\274\221\323\256\362\026\252\005-\177\016\t\206e\264v\030\213h\373q\332D\032\355\253Vs+\360\373J\377;\300,*\3009)4T3\3648\245\001I\275\036\002\212\023:\363\027J\236P\335\003\200\343\002\245 \036P\376y\362\201\375\031Z6Y\254\372\327T1\301\2202\201\312\246\037\230\353\227\020\301\335P@\t\216B\354\006V\214C\251\025f\210+\356S\003\343\033ZYk\313E\233\330\023\266.\305\0268.L\031D\344a\007\225V\314W\003#l\\BZ\205J\312R\230\006v\255\225\207\322\335\334\013\373\036\002<\3055\037,\3542\357\314\\\346\352\234\300\264$\376\304\233\3533\030\256cS\352\225\360\312^\260\221\206\343>HZ\nD\322?/\027\375\211IA\217Qo\202\2672\001\017\266\222\201>t\372\3612\271%\310\206l_~\210\271\205v \267\\.\263\270\264\207\275\357\377X\331\t\232M\035\256'\335\350\322O\374f""\2776\363\n\223\202g\357\032\261\003+\340\022\344\267\016\331\221p\021\024\031.X\340\274\230\020\020\272`\034G\351_\225\223\260S\202&\272\210\334%\275\322Y=\006L\240\232V5>\223%\035\r!J\242;\000\221K\305\003\034\243\240\031;\325\203\321\244\007\300x\207\207\277B\217a\350)\277\370\310?u7\036P\212f\030\037\210!\360U\265&W\214\2712\023\034\224GN\353\301Z\036}\322.<\376";
    PyObject *data = __Pyx_DecompressString(cstring, 8545, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (8908 bytes) */
const char* const cstring = "BZh91AY&SYI\343]\027\000\010\206\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@@@@@@@@@@@@\000@\000\340%\177x\373\336\003\241S}\366;\260\252S\266\367m\313\355\316\366\317}\367t\017\023\240\372\231\\\022\332\0325\335\264\327\313\3267su\242#k\264l\364\335[M\026\333\267N^\273l$\251*\273)\357x{\306;\271&\247X\333;\254z\321\265\2757\272|\240p\221\300\007\302Q \202dzhh\3014\023!3S\322f\247\251\342jz\010\230jyF\206\247\244\362bi\0312\006CODdz\215<\206\232\236\220%\010\001\000\"i\031S\324\362d\332I\275S\324\332\21541\r\250\032mA\220\031\031\017I\220\320\0004\003F\236\243\322=@4\323A\021\010\310\"\2334\022z\21514\320z\010\r\036\246\217P\304h2\r\2504\320h\000h\000\000\000\t5\" \010\t?%F\311\232I\372\231O&\231G\244\364\324zC\324\365=Cj\r\224h\320\001\246\200\r\000\032h\006\236\232M\000\321\250\232SP\321\243@\323&\230\021\214\246 \321\2613H#\023\324m!\211\352bi\351\251\243h&\232\032i\223\023&e4hh$H \010\004\031\023&\244\363S\321\r&\306\225<S\332j\217I\346)2z\214\206\207\251\247\250\0004\001\220\006\200\000v\036\324#\377D\010\007\253\025\201\031\356\220\243V\327Y\215\203\260\3574$\025\321D }\272\243\357\200\202\010 \200\301\262P\202\021\202\t\004\030>\272\324\207\356,J\013\261\020P\242\003\004\210#!\017`\376\277\322\336\311\376\227\304\236\320x\247\373\257j8\206&5\211z,\215j\240\342pc\317+\234\373\357\201Gw\2241\207\244.X\314\023\204\361\2404\365SXk\203\267\264=\237o\333:g\037A:\006\211\251\251\251\251\251\251\256a\216\246\246\206\273\2656\337\270\336w\372^\347\255\362#>o\231`\372\006y\177\277\327\365}\205\237.\347\371\363y\244\377\236\217\276\327\237\322\3248H\242Hl$0\225`\206\3140\220\301\r\210a\202\3040\331!\204\2163\326\201\371\252\002\212d\364\342\3057\253\355w\315\275\274\267=\037v\275\315\342\357\3437O\035\337M\302\345\277\313\216;\260\3423\231\370FZ\2675\271\255\023K-\231\246\232bif\2654\323\023Z\224\232i\246-\234A\203\033\223Z\337nOF\377\242\356\231\245d\276\231xz\362\312\335\276(\344\226_T{\337\367\026\023\020b:\347\256\355\333\262\332""\267r\335\313e\313\227$\224\267r\345\313\223[\271r\365\333\227K\307\270\"da\305h\226E\374\272k.\357\252\327\037\256\322\311\277\303q\2517\355\351\264\221\232c6\373QX\210\204\212\"(l\305\024\021DY\"\261\025\230\242\263\022DDI!w\034xW\203\017\004\236\262\035\020\364\r}\234\336\0006r\2319\357\325\252?\301\301\273\301\300ppp\034\256\036\036\036WL\235\276\332\214TX\"\261`\260\221EEE\025EE\025UDTS\226\256i0\341\355t_\037\301\257\216\377o\340\277x\275R\246\253\317<\360\363\317<\375J\217\361\210l\275\330z\345\274\033\334\2729zO\357\360U\326\304\230\222ot\252\373\357\277Q\367\337y\367\352>\371V\371\360\330\321\243\036\215z\365\252\364\253V\255[\251\273\355{Pp\341.\227{(^\261b\010 \255\004\020A\004\020A\005x \263g\255'6\277G\330\353V\277\326\345\301\233b\372m\202\030\013\367\315\347\252T\250\365J\225*T\251Q\375\243\260\036r\260D\221\030\010 \202\304\"$_\373\004UE\024U\005\027\207\236\2347\371\365~\020\214\221\025\021\t\016~\253B'\035:t\351\323\247O\377y\320\336\006n\316\277\037\035\276\230l;s\177\225\237h\315\260.d\021`\305U\300\321\262\340f\310\023*22\n\301\027--4S\020\317\232\t\344(\236\252E\014D\214\222\330\371\352\331T\276\301\214\010\246\"I\t\223g\304\373\035\027NA|\010@\204\303\321\020\232\t\240\224<p\335\303n\346<\0134q\361/Q\201m\254eZ;\206\013B\312\364\013k\301\26165x\260\013\260M\275w\242\361\300(\231\236\265\222\245\275z\223Y\337\261\t}\350\240I$E\344\310\032\t\031\206\007\337\302%\221\t\2502g1\244\\\320\"\212.\261\205\376\301s\324)\241\020\214\343\024\255\302Z\002\352\370\242\231\2500,\256\034\370f\373\024\302[\rW\020(\337\313\233\265\346\363\216\342Q\365\212\365{4\360\3462\366\260r\326\177\203\364p\364\\a\235EgF\336'\334\330nd\2045\217\243\267\315\326N+\222\237\177\317\023\\s\263-\353o\266\320\336\230\001`\301Kf\375Y\222\315Y\027\370\036{y\013\302\324\357R\321>\337\373\340kw\256\277:\215.N-2{\033\n\231\331hl;\025\253\311\372\237,\242\331U'\320\272\351\3532\323\303\347\340\030Zs\205\321#\031\221\255\322f\225\316FvP\325\3372\320v6\260A\363.J\244\300\343nYJO\356""\333\030\322mg\007{+\354\220\232\357w\016G\345YS)\311uM\310\370\352\374}W\300u\317v\314\362\213\254\035~\362\002\006\337\201a\265\224p\203p\006\310r\010\311\363\310\332cj\031d(\333r%\243\336\304\242C\t\024I\343\225\237,L:p\315\317K\242\244\232\243\244\037s\327b\370\022\356\226\342s\227L 8\017\005\203\204(\310\261%%\265p2\257\217{\334\2673o\342;\336\205\257\367K\223\257r7P\315\303\214\031\302\361\267\034F\216+\206S\204\037\004-(\325\363e\233\351\006\033\203)\263\370?W\022\274f\225R\343\017a.\037\025\365n\313\224\303!_{\206\310\334\020\320CV\211t>\004\342q\273\013\224\221\243\313\210\200\375\320j6!\265M\312&\213\202\215b\312\343\216\214\221[\331\242\373\013>\304)\213N9:\024Z\221g6\350:]\021\307\326\027\372\2778\322\002\327\205\354\342Lh\375y\347~4vt\253;\317T\214\002a($\302\236\377\275\345\017\200\216\277\234K\315\346co\343>/\214W\\\306z\006\020\355\207\253\206\037\025^@,RAe\314\210\236\3416\022/\027\340\362o\035\377T\r\374\345\017$\236{\032\014\336\314H\003\273y!\217\305C\265\3345\234\313\"\334\242\323\314\240\234<\337\311\nh\216v'\305\273~\374w\343\215\246\236,\240\345\212\r\036x\n\335\206\374\267\253\327\037B\361x\325,PJ\340\321\356\006\330\026|1\276\253w\370\361\203\377%\311(\343\204\251~\377\351`\370\272\270\253\244\014\024\275P\343\t\367\026\263\341\234K\303\036\272\227%\336\025qN\257K\275\327\356~\005\2407k{\2702\362\212\320\325\275\335%\324\376Ix\306\242\267e+t+\353\3718\016X\363\363vj\032E\330\3301\0058\255y%\366\036H\360\344\307\374\033:\376V;\035\206\217\030\313y]\317\201\252\256=T\325*\252\t\301 \271d`\227hL\223\2679\003\270T\227\334\324\372\020\357i\250\021@\275\352\272XpGX\3063E\217z\337\356\234M\334\016\313OQ))HE1\360y\343\366\313\373\343_\210\225z\367\3177Q\324\256\353T\222I$\222I$\222I$\376\353\351\336^]:\304\257\263\214\360Q\332\350\311\222C\004;\"\033\277\177}\334\251a\337J\316$\250\016\234\261K\274\035\301\271\3229\375\001\313\270\375!\003\276.\254\300{\235\226\361I=\334[\341\010*\345\246I\344\323\037\002z\212\224\311M\365\255|\276\237\203Z\246Bx-""\323c\221\370+B\n\270\000`!\306\230\371\335\375F\337\303\025UUM\352\210\027\324Joyb\032)%\237U-\302\336\\\004ib\212EWY\244i\2461\226\nq\352;A\037\352\024\257\200W\310\336\027\206\277\247\263\217\301\021\036>\221}\322\370\311\310\313U\r\371\364\231\234\003\301\2168\2633337\\\317%4\241\305Y\245\375~Kw\031\240\336\257\230I\374D\243\300W\r\014F\013[T\325\337\350\030\247\352\023\331Bx`t\343\342Rr\240\344U\314\001\356\372\271\267kY\334\327\264Co\243p\237d\252\370\370\3754,\344]\364u\252\314\346\236ZbC\356z\027\346_\226\254\277\233h\352/\340\270\213ExVR\322\340\252\302Z\2728\364\023\345\271\220\210\2515\032\006\246\301\023\263\367\270\332\037~\023\360\371\225\216C\321\371+\317\370\\\220\240\351\227\206\035\377\014\207E\005\204LLh\242\261;!M\202\250\"\341\031\221XOpm\200\3537\370c\332>\t\035\241\315\351\201\351r\367\2767\320#\275\311\260\273\016gi\251\376Eq\261\2161\306\2631T\234\324\346Q\243\236\353\253\361x\212\265\327yH f\355}\313\027\026\225\010w\336\340\317H\210\220\334)\214\247\340\255m\275um_\035@\257\204\210\n>\267\300$\"\353\002\0332\215-\r,K\3059\303J\345\r\3046\32170\364o\333\327[\313\236\352\0076\3258\375\014\270\313j\263\231\267X\256C\023\013\315\262\331\0358R\024\2049\373\320%\224]+\311\213[iFe\340\337lc\213\022\272^\341\236F\213i\304\236\324\377\271\312-\243\206\243\t\375V:nB\273\222\261m1\233N\265\240\221$86\372\306\r}\332\01461\3556\355*IH\324\313p\344\0272\342S0\271\253]x\225~x*\262\007\300\3347\364\224\365\227\036\306\010\324b\302\205\232\023\260\255z\340mO\242!\260\234\233\233c\234mXi,`t\321\013\264\372.\364\330\261\353\225K\302\227\205\215}N\204{Rfvz\314\273\353\277\016\365aT\244\205\252H\370\3715\312\276\027\265\322\267;(\311\311\323X\370\203x\231\254\3627\337z\360\211\331M\230LK\234\364\037\321O\211\332\271\022\246\302\366\026\365\275z\013\330\302\363~\374\375\254\343\276D\235\0215\372\264y\315\325'\264\221\\\333s\344x\302\352\272se\316c\343s\371\327\252\241\223\347\243S\247\342\273~\351ybn\361\372\234\341X\270-\265\333XV\342\341\253\255V\341r\305""\324i\373\000\300v\304\352\030!\033\344%\235N\2376\354T\013\341\375\216\0072\272\202\006v\330N\260{\346\2405\372\206\314\"\332_\337\ra\363E\354\252\213\332\036\321\007h\003\310\002|\212\210ig\240\316H\363&\344Qy\021DE\306\315\307\300[\366\255\"nd/\265\256^\347\2541\325\035\301\003\224d\345\267o\r\230\214\305l+\206\224\310\224\266\032\336k\331\354\354\016\270\353\273\336(,\022\322\n\323\323\260\034`\317j\234gPv(\247Pg\216\262 \345\326\321\006\"\014\220\331\227\274?!\325\027\255=\270\244\247b\310\373\2703\306\330\262\320\314On\373\203\210\343\022t\215\245\206d\224\215\354\"C\n\034)\322:\004X\227jVJ\274+\212\016\271\204\262Gf\335\273\223\334%\263\035{\3046K/\344[\013YrT(P\0334\212c\026z\304\247H\243~\303\311E\347\211\362\254\253w\177\216\263\253\332\364\364F\356\036\322\350\274\3664\365.\213\271Y\220\362|\257c\352\274\271k\320R\327k\211b\277\325\333\341NCRq@X\334\220j5\252\272\253Uj\254ZN\367\244\356\242\270\020\202\321R\362k\250R\2234\222\374s\376\027\030\367\013\370E\347\353\260\360\367;\316ES\024\330\347\"\237\r~_\027{\335\225+\340\273D\245,O\353k\352\236[\311/F\210\026\237(\227\221\217\"bsS?}\007\220\357\340\271\177\030\337t\317\306\3678\006\243\253.\241\353\353l\233\352\270r=1a\357]\200n\227\022 a\3265\000r\3538\200\002\371j3\250\323\020\350D\210Gwy\"\227X\260-\210p\2145\323\264\264\372ZEn\330^J\374!\376\336\210\334\330\353\351oV\273\275\r\035\003%\323\271!sI\220a\334\356\3342\310n~\027\233v\014(\021\"R\206\025\204O\273\217\007W|\037M;2\275\246z\013Xz\177\344\265\241\273\346\254\257Y\315\346\353\370\222\213\033\357~\326\333m\2603\315\251\263\337=\266\226M3\005\302\030\352Z\320\324\215\313)<\231\241\320^\022\300\205*\204GF \354\336\233\235\025\202k\302+e\272;\3405\271mU7[a\3640r\276\205\312\260\\q0\300Q\335\330\342f\245\013\322O&\370\n\033\356&\334\036F\205\225\222\217\005\303\014+@\315\247\272\261S\365\316\213\035\021L\243\352-d1\202\031\321\311\00533\215\343\001\302f\0164\341m\305\035;\214\3007x\004\260\025#E[\330\356\034\3330\"\016j\033\207]\305\215\254\032\364""\201\260q\255\241Q5.\325\n!-d\220A\371\223\222\334\316\206tNQt\254\n\205\335\263\276v\217(_)|\254z\336\037e?\021\366\273]\265-\030}\310#\250\336\371W5\004\265\216\233`\016n)\004\222\\\\\345\324t,dx\365\326\220(v\315.\310c\213mB\235\372\216\203\221FF\030ph_\340\324\357\2772$I\235\331u\245\261\215\223\277f5\267d\372\321*9Xgf\353\020[B\302\323 r\267\035\005q*\217s\263V-\244f\256;\026~!\244\246\236\214R%\274\320\236B\345h\222/\325c\250\016V\022>\314\t\264\030\310\264K\237\317z*\266^\225\376\010rm\274e\022\373\252W\314\330L\236\240\350\316\251\250\r\2609\0340\200f*\001\215\235\200\304\000u\220`\372\212$\324\304\255\346\347\316\342\306u\026f$\033\370\024c#tF{s](\372\342\001\205\355I\226e\232cC\016,t\360\312\t}\276\216;\272}\244X~\370\251~ZhC\034\205 \330\037\010&\013C\226\231sr\244\265\261*\206\320\202\t\316\310\232AE\246*\351jE_\016\010\024@v\303\242\215;\247\016\226\370\025\277;\205\236q\305\265\370\361}98\231\274\214\364\253V\002\315\341j\315\010\367=?<}\310\3732=A\370aD\246\344@\024\233k\337m\317\003\006O\030\343\227yW$\235\021^\327\212\244C\034\264\203+\245\346^\352\311\250K\235\321\246\030\035\024\255\314\013\200|!\211\362\320\2279f\352\236\361e\325t\254W\210n\270y\202*qi\255\210,\0304\355\264\316D\034|T0\245mS\233D\264\307\202!\023\213\322e\022\375\006\235U.(\341(\275\265\313]\001\301\017\0273H\tTT\254\312\265^&\264\303N\313\252\232:rQ\260\263m\2052C\207s7\270e \227\361Dw'\022\367\360\236\231\333\202I\322\377^\211he\332\305\245\320\024F\234V\022\260i\261\022E\"\212S\321\300\"<\277\010\256\034\357h\240\302\3670\032\350\025\362z\006\320\272h\245\\N#\362\315\2546\215SNnam\036\261\232\356Q\324F\255v\327\215\335;\n>\235s\274l\323\273M\264U\363*\252\250\212\212\252\252\"\252\252\252\252\242*\"\252\261EUUW\020\301d0M;`m\034\254\320\325\227]\r\266\230\334@jHKN\322\270\351\312F4:\220B\231\204gX\311&@9\223B\"\034;\305K\372\201\000\005\010\335uzYW\207\017O\315\367\274\037{\327\357\374\326J\226G\323\230\221\232\303J\317\273\307I3l\013\223\236\005\322&Z*I\037\"P(\0054\201\241""\014\375\233U\240uv\226 u\316\301>\001\311\327|\267\272\367t@\323\271DD\212rUA\022\201\225\277\n\272<\252%\322\355\324a\341q\3347\214\230\340\224QM3\004\026\022\260\351\223t\213K\010\021\020Y\324C\242\240xm*\037\244\006G9\035\252\302\026\353\210on\305\325\230\364\263\354\210\356kA\351\200 \n\240\200Ao\316\262@\0060:{\362$Ym\251\023\315\323^9\332O+B\346\214\333\206]\236?\025o9\302\346^cv~\030\002\322\326dg6L\332a\000KC\n`\301\267\00434K\320p\023\306\n\211N\223\240\032\345\224C\216\261|\372]~\276\276q\014\333\006\000\211 \252\210\"N/!\364\037Ka\343\211\305\267\253\305\202\341\344\211OOk\254\037.]\240r\322\300\231\354h\323A\304-\360 \213}e\202@V(_\207?+\330Q\\\231h\323j\370\305\331wA@\250<\225\370\027\320C%\260iz\303\232\315g&\006v<\235\242\212\025y\333c4I`\030\220\304\235\2077xen\357&\341\305\274X1h@s\240,\003\266p\340\033r3\200A$\222I$\232\022\013\305a\030x\210F\240\004\331\227l\000\355\215\3052Qu\232q\232\252\260\222\024\212\267T\357G\301(\310\264+\t\261I*\372\3553\256e.\240$6\026\014\211\301-\n\023\254\010\025\034\303\3221\026\262\223\027\332\001\332\201j\020\261m\326\232\207N\323\330A\212\335\204q1t\035\345\230G1\342@G7\032\342\031\017\316\356\320\0162\374i\305\312u.\314!\010N8\265\204\r\272\220\361\276\336\004\004\262\240\006\341\261\334X&t\333\245i\223\311\002\030j2\340Qd[\314 k\215)Y\023\016\210\343\215{P\375\254nve>B\n\325\202k\2312\201\241\317cT6\325\204\242\300P\214\"\014A\276\021e\025\327V\215Y\272s\341\252\362\346\213\362\001\035z4\262Y\270\030\356\273\010&\263x\r\211\300\232\322S\270\311[\022\244\033\245\026M\367I\272Z\021\234!%\305\332\341\r\242\006\267 \205tg\253E\246\206a\320\025\302u\223\030\245-(\t\r\357\r*d\206\314QI\027Jd\332'\277D\004\220E7n\302V\200\221UE\356\247\035\260R\221e\\1l\332\024\312\352\031cie0\222\014\350,bb\027O\201\271`QgZ\265\247tD\325\201\033p\017Vd\353\217r\2712{\335\301\230\337s\262}\314y\260\303iI\364\263\240\217A\304cx\361\006`s\016\214\001!\243\213 kl\312\202\211EP,\212\006\223+T\330\324Zq^\245[\"\332\234\227\304\330\215I6""\233jE\320Z,\256\341\235\222\2142\256\016U*9S\211\263\2113We\235\024\\+M\020\023/\202\026\313a1\r\246\206\030\"\026\224b\240\256\014\224i\360\300q\027\316!vWex\255\240\036\032Ly\225;\203\301\354o\252\356\310!\223\230u6qmBsy\227\263\242=\372\321\001U5\001\353\226ts\347\352\262\223W\347\003\312\271\036\351\200\247I\374\247\273\351<&\033\362\000\353\030\355CF\"J\nh\006\222\204\334\251\235P\332\311\255\267\036L\235\313\320\216a\226*\212\250\223VE\003*i\325M\320\346\242\316\244\203\232\242\332\267\3639\342\300\303\005t\2706\274\260\357g\316.\255SKW\253\316]\030\032\2750\246\331\r\326\215\0011\215\305\\H\221(xnD1\024\314_I\336\210\353\226\317n*\264\300W\361\235\177cv\367\360\35370h`Z\232\273X\266\320\233\0029r\255\225=\353\010\000g\201%H\033\33311.\024\207}\2011\260T\245s\353*\333\366\351=&~\221\311\210}}\227\276\330:\327\0102\226\346\332\361\315\022Hr`\275\267d\260\\ug{\264\357\223uA\341\322Z\313\3741\021\023f}\356[<T\242e\254\265\333\244\274\014et\3331\361D9V#\207^k\014'\325R\335\213\n@^\226H\232K\024I\230\201\013\363\23011\"Q\324k=\262\022\014+\277\024\223\226\323\r?)\362\236\257\037\253\323\352\355\365[\222\320\216t\243\377\234\237\332\232[3\217F\324\223\344V\275\321\033\273\014/\335\335(\371\232\363\016\326s\221\320<\010\234Y\326R\244\234V)8\204\004dbs0\270\303#\265g&1\034\2755]\231\225yz\3077&1\r)\325\3377\340j\246\035\030\361\356*\210l)\010,\020dD;z\350\013\314\374\206y\255$\036\341\264\353p\271-Y\313\223\207\301\215\334\020>o\007\032\354\335\241c;\265\035\33323\210P\231.5zG\023\224q_\356\363\240\226\036\315\272\216\235P1\271\326T\"\025\245\311H\021#\260\354\334\027\252v\306h\334&8E\337\\\253\341\326A)\327JKe\322\263\314'vr\232\302\234\216hS8\272\313\333\243\2101\246<_\027$\373;\324\362m\205j\352\263\333s\213\267J\254\277g\234\321\275\354{\037\320\375\\\315I\234\224\254$7\250\251\302\312\366\356p7\270\246*\376)\340\336<\226\350\025\333b\010\231\271\027G\200GFt2\234\247)\020\274\251\341X\022\204\3309\237E\330\026\334AS\251\224Ac\001\260#6Y\223DQeV\256\"\336x\020@""\3717\252*ZG.\361\374\317\276\354R\253A\372\315\320\"\241#%d\030d\031\017\031\023z\023s\364\312\250$\t\\c\t\223Q1';l\004\005\215\350\214\004\206\232D\353\177E\216e\217\301\337\371\361\356>\307\365\2724-j\363Jy\315\303\206H\340\360g\304\352\256Q\362\251\320<=\306\006y\033\250\326-\266\236\257oqz\261y`\210g\351!\245^\027\333m\231\025I\205S\202\346NB\030\246\3230d!\r\241[\001t\215S\006\246c\243\234\271\013\322\027\246\326`j\265\263a~\301\226\311\207\276\336\366\324A\241P{}\033\034g\014\200\242\0132\0043:\005\250\304!\365.\227\004\256D[+I\3761\007\017\003\361c\211D\332\362\270\222\010\033\0135\241\251/D\363\331d\030\037\035%C\272\322\001\203\000\244q\251<d\226VUBP\200\313\0261\255|\215\335\214\247\2110\332\031L\304\\\n\234\006\314d\261\244%U\3511\240\204\261CbB\213\335\n\300IR\325US+`\031#j\306\014g\216\022<\241\371\027\273\202\264Mr\226\221p\225\002\351\314J\240\202HCI\023\210\244N\t\020\300p\021\003`\224\220\034\375\030i.\201\304\027e\004\3543\215\363Y\266b\224\240 \2501\365\350\303$t\235H\315\375\331C\035\320C\232\314\203f\032\300b\332\323\003\324\302@\264\"@\262P\303\004\244\331\022\221\366\t%!9$\231\020\221\014\271\355\320\243\234'\\9\255\002NH\n\031\336\372\231\016\220\364\231\316\217i\364\275\321\265`\232\001\336l\2135$\234\336J\227R\\\003q\335\272h\2647+R\022\217\tT\0100h\017\033bL\032bi\200\211s\253\217\311\301\001\243\032;\327@g^\034\346\211\207\27576\247~\262\022\"\346\250^QW\276\253Mi!\277\na7\242BT\001d\321D\275B\222\345o\312\227\264\370\331<\n+R\333\3742\030\232o\233x\270\250\306\t\245\\\350\273\326\tV\260\231\010\210f%\301f\337*d\262\305,\346\366\377+L\230\006\300Qa\241\"u\0313\262\302\340\034l\021\233\\0\243\324\215\221\252d2\226)\215\nf\312dk\030(\3005\241H\001\330\366\013f\303?\003 \244\213#\026;2\224P\205\233\201\001^s\033\360BfR\321\211\314w\032\212\366\006\200\316M\3161BITDrf\234\377\017Ly_\237\003\254\324\001\342\356tN\210\324\370S^\305D!\220\236\252:\353\311\267\302H\335\344\345\335\341\320\367\202F=\"\024#K\347z\300z\302%!/\220\342B.q\331m\257.""\327Sc\r\321\267\234\t\243\246\220\032\205\370\243E\004\314\336\014j\272\310\314\320\307\215\3722\206\300\307\000X\252W\003$\361`d\253~\347|\213|\314\331c\235H\202\036\022\005\002\266\306\305d`\0250x\264rB*\023J\360Bp\217t\327\n\341\\5\031I\022\236\262\024(\272\340\231\263\252\364\271\020\344\021\234j\207 \214hQ\004\202>\343x\367%\215\007ir\001h\301cp\004;\204Z\241\020+p\367\243\320\361\215[\351B\310\214\021H\240\262\"\n\212*Nzz\275\037\211\201t\234eTqe\010P\2050\311+\237h6\236eq\\\362\246\001np\252^+\310\270\205\244\235HC-CF^\273b1\323\232[+\244\003\352\343\215\211\321\266\026V\305C\241j[1\241\351a\316:\333\233\341Dy\216\200\305\335O\t\304\262\215\366\317\023\005A<y\261A\016\201Su\236\273\264\307\261\2555q\322\2723\210*\313\313\010S\332\227\221!\252\361\305\204\202\335\330\204\224\303s\325\215,{5\0324 \222\305\244eu\255*!\215\236\351\024\220D\377\317\264\206\215%-,F~\273\211\255\355%a\"\303\305\220\032y\017$\270\322V\004\tq\2640\001\025\022 \243\216sf\263Vm\310C6+\256\275E \205\367\022\214\370r\3142I\202\0065\032-%\211\017\032\364\2101\031t\244}bNNg#\346>{\350h\343\333Z\346\335\332\301\276\265\253\2157u\211\205%\t\t4\361\305\020\320\345\330\2029U\312\233\341!\027\010\2008\016\257U\231\220\360:\210U\305\022Sc\n5\345\246\353\257+\020\345T\221&&\330\254\202\220\260\317B\2348H\236\032\354\2213)D\230\363x\037\0252)\030W\265\254\213ML5\262\030\200\223-$Hd\240j9\365FC&5[\025\273+a\247\024z/\306B\325MEZ\017\3539w3k\253\221\361V@\343]\224.#\225\264\246\367\214\247\310\032\313\350S\250\025\310\200\032-\337B\006\365D\340\tz\204\262\272\245E\346c\013\326\244\203\215\235g\257\342I\351\255\361z\224T\221\035\316\310\330\r-\3018$U\223l\330#1\304\340\230\260\210\276\rn\320\247%\t\010\312\375\360\213\3114\020\210\032\347\224\350\010\032l,\231nX\344\"9\262\322\243C\267r\217A\234\035Rjg`9KA-#\033T\236\203T\324l\t\376\311D\013\360\365\236o\214\351\363\277;\354~m\032L7#\206\216D\304\300n\277\034\200\2408\351\020*\303\311\365\330qd\n0\202-s\212\344{z\316)\210(\265\332%3?N\301\300\314""\263\273\342\334A\310\326\026\035\302\236uL\210\242\250\242\350*\221\271\236\261\266f\255Yh\323\205,a\261\365\021\260'y88\267\324u&\000\004V\005\010E\206\217\001$\210D\323]eby\304_\t(\251\230%\354\347\213B\321\313kx;\035\324S'\242\022'=2\027\316!\267\251\240!!\212)l\255r\312d\341JO9\322\r\030S\242vais\274\200\243\023\220\223Q\0041\261\003O\306\247)\023\24450t\225%1aYj\330Q\203b\315^\255\2350S!R\003\213\021\227\340\0144\345\251\022 @~\353\026%\236e\264b\0321\220A\337r+\005&Uw\017\245B\221\310\333\270\327l]\222\275{\014\231@q\201h\304c\353\205\365\232\250\226\305\027\262\354\361W X\023\343\203\212\245\322\242\034\220\264\221;\250\360\253\260A\364\253\021\r\312p\360\330<\332\004\304\256E\350X\001\370K\020\336\202\2561!Qd\035%\005\010\325Z\305\026i\252\014@\303\231\320\215\203\226\360M\020Jh\310\202$\2424\n\347\311|RW\013W51\272\353\224\254\237'\\\356\263ZU\211\312A\355B\206\305=LX\214\312F\253\211\3619\020\341\202\337\311;\r\034u\000\221\326\302\215\033)\032Dl\346+2\200\355\036dD\033\213\020\265\260W\010\256\356\202$J\233y)]v\242\324U\225yc\205\303b\255\\\002`4\234\\m\267\311p\366\005\333]\265\354FW\261\334\203uG\025\037B\300\"\220\t\010\245\335\025\240\r\211\204\276\332a\334M,\303\207\307\212.\\\331%\334@\310l\225\334\202*h\003\010\306\034\364:Z\366\304\233\230U\331\367\356\201\206H5\363\253\013\240J\337\036\030hAD\251\326@\313\002\"\363\022\3068\323>\245b\334\341\201\255\374\223T\033I\2559\327\004\273\355\203l\265n\372(\271\016N\245\365>\247\315N\353=c\364o\370\366\353G8r\260\210K{9\254\346\221\340\\Jd\037%\226\202\245eI\336\336D_o\266\225\315\272\363\272\313\237T\246Q\227P}\342&\212\3356\302\245\032\3621\025[\007|~\337{\364\365\271\272\372rg\305\275\032\024}#IR\214\370\2657b\227\241r\215\202(3\375\366\243\324\200\201\322\367\275\211\220\230\316w7-\231\205\314\276\313\334*.\251u\210\200\306\220\023\207_\\t\3508K]\211!Wgf\323gx\322{#\366\244\026\344\221\337^i\271\036\314\036RY\320\250\330\365\2179\232.\217\222\032\001\270`E\220\326{\373\020#\022\335\226`\306\356\2500o""\2321 \201\252A\202\007\363\375Q\006\"\226P\010\313\213pu\033}\017\312\375\355\002\353H\356\361\004\213\256\361\243\267\224\2741\031\210\316\321\236\261\367\367\211b\305\371c\365w\303\261\332\006\325ETG>\206\"\005@\321\250\230\205\305\320\034i\365\250\273+\034\207F\343\023f\253S\314HYF,\026\"E\202\221br\317\207\326\317:bt\0027\003\264\216 z\017G\211\331\365}c\345x\275\306u\352~\340\363\350\212\363a\030y5W*\356\275\214\014o\206\013Ym\205\262\363I\314G\331\311}\034\006\350O\2602\"\030Q\376\020\"\257\2716\372r\273\337\247\371\235\351\023\312\252S\366\262R\210\202\025\240BY\035\374\002\252\207\327\014\247\225\254d\300\024\001\301\341\214j\265\220\240P\315\246#U\254\000\206\222\237\301,\274\361@\240\234\221b\262M0\0039\010\000\245\265\250\315\310\244\307\264\200\"\336\300,\366\370\337/\245'\232\235\240\272\362ay\353u_\321\320\251\325\256\370!\341\207M\n\244\245F|\305\322h4\320\033``(i\r\324F\263^\326\214\313\347\031\256a\367\347\016\372>\035M(`\335M\215\252\304\213\375\216\257Fc\000\274N~\000\373\266[B\322\000\242\357I\013\223\033N\006\241\321\335@\311a\340]4k\201\376\020i\254\244\230\243\215\340\362\200%,\210\370\262_\342\003Y\316\r\213IxURPQ\233!\022\006c\215\263\035\311\004\200\253!\200\234\343z\346<\n\266\323'Sq\233j/PI\2000\001~\255\276\205\010\006\253\342N4X\254\031\327\262\034\036P\324\221A\202\232\202\231\001\224\343'\030\251\322\321h\330\277\031\227\301\321\362\361\320@\311,F\002E\205\315\344\363\224\316re(T\200?\226*n\362\270vSC\033<\3553\341\251\343\323\341\321[\244ut\316hkNs\241\364\300}\202\350_\033M#[Bu\005O\023\nYrs\370\351\346m\261E^\376A1\216x~3\365\345\r\214x\372\200\323\210\323\023\340\314{\373\211\223#]C\343\\\276c\275\235\031\2276v\220\3576\322\177\243\363^\014\271\337feh_\331\367\367T\347\310\255f\034m\200\252\276\361\3462c\326h`\271\030\305Q~]\344$\306c;\214k\236\322\356\364\220\303\031\227\342\3446\217\264\024\237\027j\177\216\336\025\307R\332|6\"\260OQ>\326\266\030\315\302\303\321\361KY\333:\263\371\246d\010.|\356\250\211Df\001\2758\\\274'<F.""\005\312\211\3231=\322\305R\n\035\233k\270\202_\r\237c\016\307\006:ZYqR\233Y!\350\341\376k\340h\243\335\371\317\026\206E\013\021\273\271\262\256\311\024W\357\035?\002\336\355\330;N\034]\337\212\272&\005D\340>\245\021D\227\231=\237\2165D\261x\362} \354\307V\271\240\346l(\211#t\221\211\253\2528Q\373\215\007\365\356\216\236\r\343\270~\037!\3349O\360M\232n\370_\202&4\366\037\257\216w\204\2349\201[\251\333v\017\016\344\rJ\204\246R\014\210t\362\3565\214\024=\333\274\3417Y\235\203\261\250\t\357\272\205\304&s\031\201\030Ok\002\303\303\321\3048A\334;\213\024b\305\\%\026\007\310\254\013\272\324\336]\204\223\330-b\347G\310|B%\223\325\022\345\326\000\233\013\341\335F\010\027v\201\025>\026D\2218 \020\020\301\270\363\313\221\350\233\316\020\035\302\354L\021\032\255\004\210\225\030\322\254Y\24653\261\334P\225o\016\205\312\020m\034<\310\213\221p\236\323\315G\026\320\377\233\233\314v\360\274^\247\227\322\357\276\313Vh=\241\234\254\273\034\340\\\330\267\304f\203\205\3217\234X\2716\206\211iX\t\350M\3164\310\235\036\242\253#J\207\322\263\017\235\006\2023\240\323L>o9Af\364KM\034i\246+\030\323@&[\002\305\334\302U$T\2432\252\354%n--\004\207\215*\202\305Di\227\306g\020!\333:f\364\3061t$\275\351T\252\304F\016F3t+0'\030\277, \206F\203\037\207R\322\215k\351\\X\200\370\226\266\306\354\266q\304\246\340\342OM\356|\270NO\212\335\377\305\334\221N\024$\022x\327E\300";
    PyObject *data = __Pyx_DecompressString(cstring, 8908, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (8759 bytes) */
const char* const cstring = "x\332\325{\313[\333F\333w\000\233s\032hH\223\236\236\2124}HRB\002!\t\245M\033\3078\204\204p2\344\330T\221e\331(\330\222\221d\300\241\264]\262\364\322K/\275\364\222%\313.\275\3642\177B\377\203\367\275\1773\243\203\017\244}\256\347\373\276\353\372ra\375n\315\214\346p\317}\034)\367u#9+i{9Mu\264\244\244H\266\266\235\327\014U\033\227\322\246#E75uKr65\211J\255\202\244\244\025\335\260\035V\222Sl\233\036\311\350to\246$\305J\347\263\232\341\330\023?D\315\244\246J\246\236\274\273\177 i\031-+\013Z5-\215\360Gja\0304\242n\032q\315qt#mK\373\243\326\301\217Tn\353I\315\222\250\203\214bQ\205\244\030\230^FWu\207\236\317\346L[w4\311)\3444\252JJy\033\215\250\3161%U\021Ss\34721\037\217GV\026\256\307\343+\013\222\222\247*\303\321U\005\343J\272-\231F\246 \331\371\\\316\264\260\370\224iI\353\321\225\353\013+4\220;?{\3114\264%\023Cn*\304\220\202\263\311\037Nj\031=\241Y\212\243\241\023\307\322\211\201\026\032\031\322Jl\345\332\364\3144\233\237\245\275\245\216l\032&A+\"\216\331`V\"\257gh\331l\031\366\204\264\220\222\nf^24\232\005\255\003\234\r>\200y\323\306\360\265\215)\206a:l\r2=N\253\037\223\222\272\205\331\356hx\372\201\222\261\265\tI\362'\235S,%\253\321\364l\342\214\026X1c\000M#\036[\214E\327\307\245\205\245xl\215pce.\262\036\033\227\346\250\034\370$\2666\037c\313y\032Y\334\210\305i\275\264n\266\333\343\254xW\317d\244\2534\257\253\322\256im\241O\277\211D2\262\245I\321\265\030u*=]\210=\223\210\323s\261\350bd-&E7\326\342\313k\023\322\345\345\2059\t\277\035%\223\307BL\211$ \255\3152\311X1m'mi\361\325E)i\022Kh(I\317\3462l\004\232\202i\024\262f\336n\226\020\335\310\345\235\211u\235\352\234\230e\321\260\273\n\177\330RtH\357\304\270t\357\372\330\376\301\330\245Yib\202f\361\323\376\301\253\327WH\017\364wTM\035YJ\"\243A \034\022}\332aOW.CA\330(\230\340\025%\231\224\251cM\311X\232\222,\270\"\244%\025\313R\nRF3\322\316\246d\356hV*c\322,\n\206\232KO\254X\246c\252fF\332d\363\"qIi\026\364\017;\251\023\357|M\221\314\004D\211\361\273@\302\240\220\274S\303L\206\3133\026fAym\032sBZ\311h\212\255Q\t\266\232""\304\200$\226$!\255;\233\371\304\004q\351zVI\353*m\222\272u\335\235\214\300\35391\251\353*\024\331\276\236\240\236&r\205\2756\365\324?n\332\326\346\250\222\344-)\333N\3269\241\005'\332V\332*Im\373\032a3P\211\271\311l\236P\312l\336\311+\031\022jmO\315\220i \215\330\245%K\252L<\245F\326uU\246\246\240\022d3v\024\253\000\363\221(8\232\2552\305\222\224\214N\234\0247j\306$&\272\013\361e\372{l\224-\335\275+\221U\033\275+\335\020\355y\337\\*.\356\037\\\234\300eVr\264=Gb3\300h\244\377\226b\244y3\033\323\306\243\236V\376\207]5J\374\211\335\345H\356L++\2319\330,\022\230Yh\r\031\024\313/\302\263B\246\250\363\377\360ARy\332 \322Q\333>\371I\337\256\262\261\300]o\202\226\251\322\263R\226.\n1G\024[Z\232\034\014\r\006Y\223\370F\303P\303R\354\037\314\302\362SO4\254\342\231\337'\221\347\361\215\225\225\345\265\365\330\034\232]\336?\270\"z\263I\032\324M\350\326E=\231\321.\362\035\375^rEK,\004v\366bJ\3213ZR4iy\236\225\322\014\276o\303\r\014\330\236%\355\236\377\373\2617\311~3\357\342\312\253\317\206\000Ca\0008G\335n\262z\222\026\t!\361\346\246\232\371L\222\tH\232L\0103o\314\3135\226\2239U\265\306\"[\3118M%\232E\306\214\014e\332P\234\274\025hO\305z\252\320\322\200M8\036]\213<q}\261\252\013\271`\272~\315\336T\256M\335\272-4T\266\314\335Y_\345\300\036\370\342\244n\303\"'\315<\3542\251\246\252\333\324G2\217\030\001<\375\200\317w\355\243\201\036<C~c\\\232\204G\232b\261\n\363X\304@\256\242\314\310\323v~ FjS\321\354\033\322j\232\211\262\235\3178\214\013yc\3130w\r\177\357]qH\223\360\347t)k&\363\264:03e\346\215$I\t\267\347\210\276\310\300I\302&\276B{Z\343k\210T\236\352E9\267z\217\311\312i\226i_\377P\030d\270\253\226\276\326I<(\376\002\203`@\022\327\270\353J\352T\r\0363\027\302\214\r\236\334?`\336\225\305~'\370\337Vk\244\033\344\336u\342\025\353Y\214<\313\372jS\201\361(@\325\366\230\252\373\215\222\212\243\200\217Y\245\341\3317\274\350\215\027\377\215\373\233\263\177\300w\013\373\341\266\347\363\307~\210\350V<&56\000\213\36645Or\250\030\205\313W\374v\336~\007X\310\237d\032\344\3368\304@\n@xd\023""\220$jt\315\320\322\n\213\334(*\240\325^v\347x\205\302\023&\246I\004\330\343\222C\362\255AJ\327\230\\\212X\240]0rp%\253d\300\t\315\345f\206\351y\206\365\013~eu\233E\315c\257\307$%\005\303\322\274\321^\213\273\177\327\242\251\234\257\321\255\024~\331\340\373\202j\337t\033\n&\330\352Z=\337\233 \003\246X[T\2277\334f\024!%t\203\254\240\330}I\270u\326\257X>\217$\211\r\3248h(]\301T\034\n\326\023y7D\244V\"\"\010N\256\261\260)\252tw\033\366\335\327\006(\002\253\016t\221R\240\361\262LS\317\253\232,KI\026\332\262\235\247Y\354\350\264+\262\254\352\206\356\310\024=6,\307\355\306\270\266if\315\264fhP0\306o\026\232\270\361\245\221\317&\340~R-{\304\035\021\205B,\257\200CP\366\364l>\033\020\0334\240'\033\345\333\025k\312\332^\275\226)\317\340\226K\226\3056\264\261\312~\253YrD\220\267\017\327$QC}Q\360\006e\226\263v\332\236\225R\272E\031\234\033\001\010\333qq\356bkKaKE\023E\342JB\273\312\204<\227\226\021\260\3236Ol\332\216\211\0317yY\n\023\362\206\307\006n}\233\214\000:\362\007\340\232\354\356|K\334E;\205\260\237/\216=ap[\274i\231\006\366\315\315$\032<\035\222\014\306~\266\355I\n_)+\344\216\207\326\3126\n{g7l\036\231\177s\027\223\246\311\353)\335\323\362\300\276'M6\007R\020\n6x-\370\001\355\262s:\345\255\377\357\034\014\342\325W\257\307\000c\343\322\030\327\3361\030\2621f\322\306x\025+\020\225,\304\245{~\213\245\373\"N;\230\317\032^\240$\304\200\"\005/\350J\352)\226B\321\302,3+\355\"\001Fh\224\004\353)c\347B\337\330k\343\316{\026Hh\316\315\251;\267\357\340\001\021\320p\261\261\245\375\275\003\357\231}\373\200\333 $Z\254\273qi\277p \355\357\036\210\203\222YL\330\022R\315\\\002\347!\250w\244\r^\t<E\260\220\366#\233km\353\027\007\037\3006!u\206&7\2043\\\n\230un[\337$\316\010\347\254d\333\226\001!e\335]v,\215\334\227\245\244\321\344\n\031B\326\203\227\246\013\337\317\017/\370\236\203\263\233\254\007n\306\003CJ\256\357@b\307{\002_\223fV\021\347%\037n\350gV\037n\027XE\273\306\244W\024\314\362\030\246\321\003\004\314\306\322\306\342b\320\0314s&\320\264\331MB\363\341\212Onb\273\341BC#?\027`""\346\2511\036\013\266c\216\017\363o\352\240)tj\256a\274h\265n\276\317d\201\030\r\035\014\255\3506\320\217f$\321\003\216\304\214t\260\234\237\277l\352\010\333yj\310\002\210\006s1\033\344o\223\2244\3157\300mfG\333\261+\340\033\335\025\330\255\313\233e\321a T\014\364\340X\224\212a\236$\327\354\230\000\033\235\310\303\306\344\r\232\035%X\314\177\030I\305\n\362\320\215\360\371\252\365@\250\357\035[\261\005\347\r\3778.\036\211/J\221\306\370<\253\221\202'\003G;4\013\3117F\263\202\373~'J\273\347\377\346q'um\306\367\315\354\364\001\266\204\357\025[$\213\346,\035\335f\374\245\260\305y'\227l\003lnv\205\251$k\204\300\005\247\2448\257\312\350\320\024z\334LE\036\310\033K\013\317#kk\221\027\362\372\213\225X<\262\261\3760\266\264\276\020\215\254/,/\311Ob\353\017\227\347X\251\240\345\245\310\223X\004\376gA8\323\210\273\251\3677\026\026\327\027\226XG\254\231\374$\262\322PH\321\024+##\340\236\271\005\351\t/FS\331\t\257,7\325\332\232\303\242\204\023\352Uv\000!\247\362Ht\345\024y\320\204\242n5\266\241\244Y\026\251@c\205n\313\376\261Kc\025\016y\333=B\345|\303d\210rF\243\235ml 6\\t\334X\207'e\322)9x\200\330\320DI\22005\224\2203N\266\024\310\"n<\261B\206\367h\250e'\024\255%2\244W\311\264\251\360B\315\306:\357\334C\246V'\326e)$k\252\313\025d\335h-k\3460\2135\311)h\224\2335.\274\335\232\261\265\334\203\310\354\320\276\245\222\353\203\234\323\223m\252\370ifC\005D\202\235\345\264\224\272a\177CEN\241\330L\336\205\2026I\220\010\331\033\312X|\322P\2028*\333\276\003\232\236\354s4\312%FK\262\323\364(S\3508\361\203\036,Dy\264\307\336\376\260\313\023%\347b\253~\005jZt\213\325\235\360H\373\366\356\374\346(\352X2\235\330\036\345\003|\212-o\232ZK\332\215\324\246\315\007\206\365Z\341-@\216W\253\234\017-MT\n\264-\274\272\241\216\024uSk\323\004b\301\004\360\244>\230)!^\237\330\300=6\345\335\2608\246m\253\254\271\243\375\335\204!\001\342\205\225\2306ohyB\022\244\3331\323\372\240%m\250'\021\3070\344\327m\205\357h\354Adcq]\216..\220w\220\227\226\227\2421\371\376\213\365X|na>\026_\237\243\005\n\2213Rz\272\351""\266u6\255\rZ&\324\322\244=\007\232\2335\357}\273z\266\023\315\025\315\022\321\\\317_\206\372n\245}\367m6\263\271\311\311\353`\272\022[\212.\317-,\315\307\341)c;\244\332\017\0267\342p\277\224\336\315\307\0360\347\266\260\262\262\266\274\276,\257GW\026H\337\255\224\242j\354ivg(\031n\024x\221\360\323\236\277\276\037uSF\322|\274\273\024@\025K\221\245\007\217\243K\324\361\302\223\330\362\306\372\222\222\325\360[\247y.ii\323\321i\213\226-J\261\265\344\234\256:\313y\207d[K\306\211aY%\n\276\2611\305\233B\233\337\210s\243\270\353D\030\321\276\264UTNl\327\"1'\265\204\236\372\221\347\207Z\371\357hOj\305\016\211\370\033\271\0176a\"vB\013\232\0131\352\204\312\244\366\201J\034\305\t\227\364\241\026\376Q\235\253\321.\262\375 N\025\366\350\207\r\224\227\310\200\255i\251\265\330\352\306\302Z\354\tiw\334\325\362\007\013K\221EW\356\3325 \031\\~\260\266\274\270x?\022}\314\216D\327\230\373\345\3279\226\353\347\034\323BH\275\262\026[\301\003\017\027\356/\254\307\346\330\033\210\306(\273MQ\2534\264o\324\"\nm\233\261\314A\3363\255\211\0372&\205\320\366\217\023\210\213\367rV\333\346\006\362\235\014%52\316\016viE\255\317\275X\212\272\014jr\300qq|\347\")W\034o\263\331\0057\216\231\363\303h\214H\272L\206u.\266\030y\261\316\243M\266[\240\371\205\026\252A\275e\331\273\335\303\221\245{\307\0170\371\035\217\205\220\256\223b\223\271IR\001\257\331Tlq/\213\027v2^\330A\3037\374\014\206\333\217\007\032{g\304\346\261A\321S\224v\003,R2\262\"\353JBe!\252\222\260\021\036+*\216\270\2630\260\354`Q\025\206\262\331\"{\026\230\010Z\013\017\2409\260\327\276\370N\205\023\216\251d\034%k\346\rZ\227b\300\325\312 \330\247\027\032\250\002\376\220\262\023\"\006'F\222\205k\274i\251\366s\326\206b\3034Z\333\272\315\304\001\003(Jg\t\032:\t<\312\213ri\332\033U\200\214C\017\320|\325\026\366#\005d?\334\360\207q\221\305@\214\t\266\252\353\354\250O7\005P\230l\221`\350\006\365\303\317\000\335\317\006pL\226co\021\335\022\377\275\276 Z*x\260\314\315\021\014$\336\006\270h\203\240\t\323<\330\331#\216|\033\263Z\231g\265\264\r,\225""\221\023\211\333\323\374\274\236\010~\230\232\220u\266x\374nO\373_\t0\n\334\000\021D\031C'\3644\375\351\206\303\317\036\221\312\004\323\231\226\324\246\245\240EO\023\272\2230\315L\302\334K\344px#\344\237\003?G\020\036\331\206\221Pp1\341\345T\357K\005\357\343\005\210\265\354q[\346\247\017\2744\003m\342\351\234\354B\336\3021(\022D\232YRu#w\231\032 [\2201\035\357<I\335\314\033[\252\236\244?K\325-\nId\236\312\300;A\271d\334\223\304\345s,\\i\216Yxn\217>)~\314\310`\014\276!\340\245\356\367\ntK\332\311\343;U\203\2062\217\022\314\000\233\222>\266g\354B\354\315q\202\366K\020\216\305\375!ITF|\256\025 )\213U\305\342\335$\032\332\305\344\\v\037\244{\266\010\310\234\315\225\317;\034R\361\276\334\340\256\231e^\024Cy\371\027r}?/j\312G\233RP\221u\n\360e\344\207\214\222M$\225\037\335\014\324\305\023Z\340;\032|\006\301'\257\346&\247n\335`\327Iv\235b\327\233\354:\315\256\267\330\3656\273\336a\327\031\272\336\232\242\3663\267\251x\346\016\265\373\356\346\024.t\373\335\364wt\241>\033\0163\332\037m\270\305\\\221U\317:\253\374\334/\211\274\203\345\036\244\007\r\271\264\227\220\200\200\362\261(NSu\362x\355\003]\256\006B\031p\214\317\003\025\\\365\214,'\021KpH\352i\234y\220\023Pe\346\t4f\323\274\375f\024>\334\343e\374X\021\244W\006ie6\0107\354\202\251\272\310\252\264l\316)p\215\024z\3519G\030hv\330E\201\\^\225U\003\327\267\224\322L\335\2701\315\350\034\256[\026]Y%\273\247[\304\332\244\024z:M\341\355\036T\334\325r\337\270\272fF\270\336TJ\311\352\231B*\271\353\032\002\366\006y\232]gRY\207\257\216_mj\2377T\\\035a\230\230\027n\010O\033\263N\334\221\333\263\310\333\032)\263)Fm>\357h\347\363\033\217=\202'\035\215\331k\360\\L\306\2157#\270\334\264\033_Q\310`\346si\032\213}\"A\327\214\236H;\366\016\351\231i\235\020Z\240\230\215\344\276\300\240\202MznS\333\343\262\262I\266~3K\322DJ\313\204\221MY'Q\325\323\006S\265\274\355\230B|\310p\221\003\333\324\311\246SC\007\031\rl\031PV&=2\341\223\352\344\224OOM\322/p\177\323'\247}\362\226O\336\366\311;>9\343\223\337yd\322\03739\305>\231\220\225\254+\030dt\0357""F\013\246\021\201|\001\024\022,b\007\375Q\017\016M\311\241\241\034-\215\016xj\307p\207B\260\206\023K\357\254*x<\305\232\270\021CKR\257\333L\213\340W\360\263\371\207H\246\365\3266\r\374\022\270\220)\336\334\022\351\342\316\255-Z\325\226\251\317\310\026\273\346qed~\313J\330\326\016T\323\265\226\031\212\204\362JZs\031@\312\255;\360=\031\323\334\312\347\350\232\303;T\213]`\2303\266\226&)@X(`F\226!\316\270n\271V.\313\223\325@*\324\224\363d\223\267\304\313k\031!\212\302\035\250,^*\021\301\336\272\002\r\255@\027\n\206\014]\315B\316\344\254e\302\214X\272\206'\274\020\017\313\222eq\325v\275\313\236\343%\t\206Mf\207\230\235\261\231\371\321U\376q\010\205O8&fg\364\201s\344vG\307fN\241T!\207\310\317M8\\\224\375o\304\274\"|\013\206\315\341\247\216x\357M\253k8\202\244\2103AR#'\210\325Y\331\316\223\023\266\nnaV7\262\312\036_c\240\216B;%c\342\321d2\343F-\270\323r\344B\310\324\022g\350\226VI\327\254\272#\343\235?\221\024hP\022`\250\214\306wcx\037I\264m(9{\323t(\2164\350\222)\244I\244\314\034\0173\030G\335Wg9qd \266\321\373\316A\006\305\276J$\247Nc\212\255u\313h\373\364\224\210H\335\300\226\236\240\004\027\361\320\026\255\214\337y_O\020-l\031H\346P\030E\002\244\253[$\030\301\203\327\246\252\340!YSU\323)\017\257\335\341\306\200\376m\347\225\014\227\037v\356\313\244\212]\210\367\tL\242\341\2061\246\261\204\244\202\271]K\343\2378X\354\033g\225\353D\320\013\010\032a\n'm\377\313\227\226t\332+ SEd\212\376(b\265M\352>-zK#\230c\354e4\026G\004\034\275\216\254\247\320\346\220\223\212\230\373\316Q|I4\276{\024\000\363B$6O\000\r\217%\221_\311\000\030+4\366\025\004\001\264\245\315\211Z\323{\025\276\265\342\364\\(B\343Y\272\245Q\330dpO*h\313\334\265\341\362-2 \240m\n\365\024\n>q\216e#\264\336\264\301]\307\246\370#e\223\354\013/\312\276\216q\245P\224\261\357\314\004\355\272W\034I\264=\350;\341\034\263\361\204\337f~\337\3151\330#\\zl\346\343\261^\242\304\247M\030\312T\267\314\234\0238\t\221\333\234\212xs\333T\360\335\313\246\236r\020\030y\004\213\220\310Hn\331(\315\220\002\333d\334\340p\354l\332\302""\030\370Q\257\333\224\377#9\305\207,\342c\026(\025\016\016\030\340\013\333M66.y\233}/\344Pw$\224<\262\2438\237\205\250Pr\341\273=O\351(,.bl\0214\236q\022\216\272c\340w\353\316\344\224,;,\312D`\341l\322\016R~\244'!0\302\3042\331\361\276\321\360\211w\254\315;\307u\243\216\311\017\206\034sK3\004\t\037\t\023%\202AZ\27677\233\351\257\033\361\260/)\234=2\362\256\241\303\216\"V\263A\300]\002\331\364\tI\211\231\202\260\013\0235\236a\347\311\001\321j\005@\221\304\233\353|\016\201y>GJ\301.p\223yH\036\314\274\273\277D[y'%\317\344\363z\222\275\377\345/\201w\024$\276;<\277\334\241av\260g\273\360;\336\313\307\266o!\271g\332U\354]\312\215w5\205bc\002K\333\325\r\372C\302\303a\222\303\024\207\233\034\2469\334\342p\233\303\035\0163\004\224\363\340z\007\355(\353aW\224P\336\203+\353;I\n)\206\021\344\244ON\371\344M\237\234\366\311[>y\333'\357\370\344\214 \371T\030u\307}\236O\211Sn-\237\032\2430'~\030\002\323\242\261\013b\032[X\032Y|\030\266\267\307c~\022\r\372\233\331\313f\n\357\364\034?U\223\036k\205\225\371\350\362\312\213\376\3779\335\177j\245\260\314\277#\275z\231$/\257\342SE8\017\n \344;\342\314F\276\223K3\357\346\023\256\263a\037j]\035\227\374n\306\331\007*\322UV(\333\370.C\246\342+\377\247F\372O\236}\006\006\335g',\215\223\274r\352\037\376\373\2771i\347CO>Xs\347\373_\317\361\037\216\023\334\247+\247([B\340\304\314\243\214c\023T\234\"M\266\305\021\324)\234e\371\364\236G\342\350\312\275\301\021\222O\263\243$q\007\213\322\206\226\231-;\305\363W\267\236\347\261\356\035\377\214\323\275c\t\215G;S\001z:@\317\004h\236\267\264\277\027\343\263\304\303m\342& \356=;\271ri\312\026\\Z\204\334nO\374\334\260\271\024\222p*\330[ <\365\212\020\246\3727\231\202K\363\374U\320d\356=2\253\265\241\305Z<\247\023l\022,hn\347\274\013\266<\341N<\224\017\3629\037d4\334\200K\303\354{\362\001\021\342'8\\\204<z\317#\231\010\211\033&B\036\315DH\3341\261i\245\033EH\324\013\021\022wB\204\304\035\023!\217&\021\362\351\351\000=\023\240\271\310\264\277o\020!\321\304\023!q\317D\310\245!B\202v\205E\364\324$Bn\377\236""\010\211\247\202\"\344\0261\021\362nH\204\004\315D\310\245iW<2\253\265\241[D(\320$X\320F\204\002-O\270k\020!\321 \037d4\023!A3\021r7\323J\360\274\212\2751\273\026\177\030\301\027\324q\376\235\031\271\265\213\027O\215\223=\354P\357\216\323\237~\367\362\317\311o\257\214\377T\236\254~v4y\364\350X9\034}\177s\272~\365\333?:\352\241\253\225\321\312\355\352\360a\344\217H\375\306d\275w\2606x\251\034)\277\250\274=\032<\216\324\277\271^\331f\205_\226V\251\305\344\324_\275\247N\177Q\272[\351\250\014\327\007G\313t\241\232\367\275\003\207w\212_\027W\353\203\347k\347\257T\206\337\017\236/n\243t\266\270Z|[\356\250\017^(\235.\257\226\225\367\203\027j\027\256U\326\253\303\325\253G\221\367\275\203\207\217\212J}\360\314\341\273\322\331R\244>\364U\311)\317VV+[G\303\357\351\346\367\212RyG$58(EK\333\365!\242G\212\213\345p\231\306\032.\236/u\000.\224\206\001\237\225&\305\335\373\301\241\332\220\273\0166z\007f3}\270\215\261v\213*=0\364\005\r8|\241\324EO\201~\317.\203\037\027\257\226\226+\223\230\312v\3714ME!\262\366\325t5R\005\007\300\013,[ JD\277\364`\355\213\033\325\016\232#\325\036.\226:\002\225\247Q\364\270\310y9A\253\332\366\013\210\005\251\022z>|R\nv8T<S\332-\023wh-\027\313\243\274|\267\230,].\177]^\257|u\324s\304{\0368\274y\370\026\234\240\206R\231\206\375\253\373T\337 5\266\213\243\177\r\236:}\0263\233=\032\255\017\321nVO\037\255\036)\177\r\235:=\\\033\272L\373x\256\222\252><\212\324\257LUG\301\334\271R\177y\264|\253B\034;s\270\355w\346\024\211\273g\213\223\357{\207\213l\205\261\342\010v\234\212\212\021\020\037\027GA\362>\372\312_U;\252\303`\367N1N\223\033\372\244\370\266&\021\033\353#\263Gc\307\303\3074\330\331\342tq\267\244\320\236\177Wa\254\037\303\276|Z\372\254<Y\246v_\2266\330L\302\225g\325\330\321\371\343\360\361*\346\224\307p.\237\366\250\203$\361#N\255\342`\376Hq\271|\247\362\r1xh\2446r\251\034-\013\366\327\006\277\340\\\236/\376X\036.\217U\276\254*n/\005H\301{\266:6\251B\271\263<\352W\366\224\330v\014\226\346\312\375\225\223\312\277\256\254U\234\352$1\254\037\014\023\372""\360\t\211\367\351\221b\224v\272\231\016\310\332\375\343\261?\207\353#\244\214\340\366\351\303'\265OI\222\252\237\036]%\035\234\374\376h\366\230\026\374\327GM\375\266t\336\266\240u\230\233\325Io\030\350\377w\325GGJ\375\333[\325\325\372\267\330 \\\370\"g\212wJ\243`\337\020\270\262M\273z\026\033\363\031\025\016}V\372\2064\244\243~v\204\355-Q#\347\352\322Xy\273r\246\272\215}rjg\277\201\316\013\255\371\202\270\324\341\321\017\300\337\277>\306,\036\024G!<\027\261\255\320t\2478[Z-i\345\237\252cG\303L\343\317\026\247\310\216\320r\316\025\327h\026$\351\0226\250<\031 \316\034Z\305a\352\211T\345\033\232C'\255k\362=\323\033\322\376\316\322(\366\227\344\231\354\327\360\010\255e\237=5\362yi\232-b\350|q\247\364\214\014\306\352\373\241/K\353\345\317*\223\265\361\237H\277h\341\337\227TR\370\221\321\362H\355\233\037HQ.|[\231\252\254\326&\356\035w\240\361\213r\202\264\350\213\352jUy\017\221#\363G\342GV\253\376)\221\365\013_\226\236\226g*?\020O\206\241*\017a\307\210\375l\026\333\340\345\325\332\245\0312R\027\036\376\331\361'Y\275\257i^\260]\324Y\361QIa\003\227_\222\342\366R\243\221\3634\363\257\311\370]\370W\351m\3552\246\363\305\334q\344x\0255\357\312\027*g+4\301q\272\220\350\317W&I\255\310$\014`x\250F\264\370+T\215$u\233t\205z\036.\217W\024\316\023\342\006q\353=\273\370\353\330\256\177z\255\262\352\256\342.\346\t\373\3767K\211\036O\036G<NV\036W\3333\362\353\362Ty\265\366oz\244\201s\237\323\263\1773\300\375\343\321\343\311\177\276U1\262\034\255{C\344N\365\371\321\352\337\r6\177\274\375g\307\1775\030,~\276\372\340\3502Y=\1770\326\212\366\252\262Q\375\367Q\357qG\375\332m!C\337\022\323b\325O\252\333\177\010\2135Y\033\371\267p\005\227\312s$\335W\252\267\217\206}\317\014}\376\230\233\345y6\375\177j\204\353\334\352\226\256\300\342\327\207\316\0257Jc\345s\3454\315i\264\301\330\242c\350\245\302\006\275\310\315\343\340\341\202[K~\334%\322\304\250a\267\201\360q\302\035\016\n\233#hn\351\275\n\222\264\212^}w<\354V\017c\n\205\322\031R\350\016\356r\316\227\302\245\325\372\231\2630L\245\031R\2253""\037\027/\0257i+>)3c<P\232\204q\251\177q\261<Q%\037\326\207\302>\362+\275\210!\"\260!O\021'\014\025?*)\356\003\021\020\3750\022|\344%2p|\356\245\016\266^r\253p\366\304\346\323\377\342\361\216p\321}\245\021\232\317\320\205R\250\264P\226)Hx\311\205\3436\30531\262\226s\344\227~\246\235r-\315\207\036}\005\017w\254|\340\3610\213\241\270_\026\233\277^\376\227\010\321.\226/\225\215*\005U\037\035&\213\327\021\243\360\200A\301\254\207jg`\232C\360\263C\305p\355\034l\304\320\347\245I\362V\247\207\213\335\344'Ds\212\215\0204\014\027{\304\3529\033\274\330\207\370\314\031!\301\373\221\241\022\227\257p\373\271\033\032\222T2\037\303Y\367i\345*&6p8\3511\2721f\244\271\211\230\221I;$v\257h\303\315\234-~\307\"?\3223Zh5\\\335\240@\3067\203\237\326G$8e\027\316\375\313\323Jf4\303\325\325`\353@`\250\324\317\221J\225\363\225G\325\014\351\301\330\215j\037,O}\354f\365Vs\314\350y\320\007\307\351?\251\303s\340\006<\325\244K f\010\321v\rV\243Lk\177\374\251\376\323=^u\027\023\253\334\202\375\346\212:\304\nC\265K\267xH\331\347\306zZeR\2508\231n\336\363.i\023\234\341ty\273\274\212\200\275\377\360\333\"#\240,)r\324\035d\276\303\037\035\256\327\206\231%\272U]\257}\267R[Y\257\255\3535=[\313\036\374u\352\324o\035\367;\t\356w.\002\026;W\000+\235\277\000~\351L\000\022\2356\300\356\334\005\354v\336\353\"\270\3275\007\230\353Z\005\254vm\0006\272\022\200DW\n\220\352\332\006lw\345\001\371\256\337\001\277wEC\004\321\320\"`1\264\002X\tm\001\266B&\300\014E\303h\022\236\007\314\207_\000^\204_\003^\207\267\001\333\341< \037\216v\243e\367<`\276{\031\260\334\035\007\304\273_\001^u\313\000\271{\013\260\325m\002\314\356\\w=\304\344\251\370\2404N\3463\324\363\307\316\341\263b\214)^/\305\253\365^&s\347\213N\351\247\312X\365\\U=\032\251\335\215\327\342/k/\345\232\234\250%R\265\324;\352k\337e\340<`\276\363\021\340Q\347\022`\251\363\031\340\231\313N\025\240v\246\000\251\316\267\200\267\235\026\300\352,\000\n\235\277\001~\353\214\200W\221\256\030 \346\362\3709\340y\327k\300\353\2567\2007]I@\262\313\000\030.\253\337\001""\336u\035\000\016\272\"\340j$\364\010\360(\264\nX\r=\005<\r\275\000\274\010\275\006\274\016i\000-\224\001dB\333\200\355\220\003pB{\200\275\320c0\376qx\r\260\026~\006x\026~\tx\031\376\005\360K\330\004\230\341\035\300Nx\037\260\037\376\r\360[\370>\370\177\277{\003\260\321\3753\340\347n\005\240t'\001\311\356M\300\246\273S;\200\235\356}\300~\367o\200\337\272\357\367\240\227\236'\200'=\353\200\365\236\215\036l#Y\2743\2653<\221\034#\265\235\377\223\014JC\311\337+\306nmw\237\272\374\265\243Q)^\002^\272\233\231\001d:s\200\\\323\206-\001\226\272\326\000k]i@\272k\013\260\325\265\017\330w\265a\001\\]\010=\001<\t\275\004\274\014\375\002\370\245I)\004\377\177\005\374\032Z\004;\027\303+\200\225\360+\300\253\260\014\220\303:@\017g\001\331\360;\300;\227\377\217\301\300\307\256\246<\005<\355~\tx\331\375\026\360\266\333\000\030\335\007\200\203\356\010\230\033\351y\004x\324\263\004X\352\321\001zO\026\220\355\211\364\242Io\014\020\353}\006x\326\373\n\360\252\327\004\230\2756\300\356\215\364\241e_\014\020\353[\007\254\367=\007<\357{\003x\323\227\004$\373L\200\331g\003\354\276}\300~\337\357\200\337\373\036\367c\r\375\313\200\345\3767\2007\375I@\262?\007\310\365;\000\247\377\000p\320\037\031\300\260\003k\200\265\201\247\200\247\003\317\006\376\1772\001/\000/\\\245\327\000Z\327&`\263+\003\310\270\202u\037\002r?4\017\230w\225~\t\260\344\312\227\002PB)@*\244\003\364P\026\220\r\345\001yW\314\"\220\232Hx\0160\027~\010x\350*\275\320v\025\240\206S\200T\370-\340m\330\0018\256\356\337\203(\335\353n4\326+\200\225\356g\200g\256%\020\306Z\005\250\377\304\004<\004<\354Y\006,\273\226\340\031\340Y\317+\300+WXs\200\\O\036\220\357\331\003\354\365\374\n\370\265g\016\3429\327\373\030\360\270w\005\260\322\033\007\304]y~\013x\333\273\r\330\356\335\001\354\364\026\000\205\336\003\300A\357\022\304s\251o\003\260\321\367\022\360\262\3575\340u\237\002P\372\034\200\343\312\363=\210\347\275\376( \332?\017\230\357_\002,\365o\0006\372_\002^\366\277\006\274\356W\000J\377\026`\253\337\002X\375\273\200\335\376w\200w\375""\277\001~\353_\200\220/\014\254\000V\0066\000\033\003\317\001\317\007~\006\374<\220\001d\006l\200=\260\007\330\033\330\007\354\017\374\016\370}\340\321 \244gp\025\260:\370\024\360t\360\005\340\305\340k\300\353A\r\240\rf\000\231\301\354\340\177n\203\307\312\016E7\377T\027k\237\337\250\366T\363G\321#\247\026}Q{\361\246\366F\361\307\274Q\rQ\270\374\354\350\361\361\356\237\312\373\306\222m\026\366\365\037\215\226\206\017G\337\237\031z\177\356\223\372\231\241\372'\347+\243\356=\375\035\216\226\225?:\336\207(h\255I7\252\003G\337\037o\325V\327\352\241\263\305\237\312\227qv\200\321~e\307\037\275\223\325\341\332\324\334\361Rm-^\017Q\014{\302\203?\224\366X\236\342?\210\264\357\367#\343\317\210x\354\257\217N\205{\377\330\303\271\034[\007\216\030C\224\351\013\032\271\311\006\305\306?\224\017(Z\246H\357\322a\206e97)N\335\256\207z\017\303\207\033\305\321\342\315\242\202\244J$g\3653\237R\3766Z\377\030\207-Z\345&\005\266\030\315\030\0377\356\216\347\356\216[w\255\273\227_\3752\376\372\333+\343\343\266G\356\270\024\376\357\276\332\364yrR\313f\223\267\254\377\005\365\241\351\204";
    PyObject *data = __Pyx_DecompressString(cstring, 8759, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (21268 bytes) */
const char* const bytes = "Bind: expected a sequence, got Check the query against the passed list of arguments.<Codec oid={} elem_oid={} core={}><ConnectionSettings {!r}>Consider declaring an explicit composite type and using it to cast the argument.GSSAPI/SSPI authentication is only supported for TCP/IP connectionsNoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.  Note that parameters are supported only in SELECT, INSERT, UPDATE, DELETE, MERGE and VALUES statements, and will *not* work in statements  like CREATE VIEW or DECLARE CURSOR. (OID OID value too large: {!r}PostgreSQL does not implement anonymous composite type input.TimoutError was not raised ., @/'{}'$: ... (?{}[])a sized iterable container expected (got type {!r})add_notealready connectedarray length overflowasyncpg.Protocol has no reference to its Connection object and yet a cancellation was requested. Please report this at github.com/magicstack/asyncpg.asyncpg/protocol/codecs/base.pyxasyncpg/protocol/coreproto.pyxasyncpg/protocol/prepared_stmt.pyxasyncpg/protocol/protocol.pyxasyncpg/protocol/scram.pyxasyncpg/protocol/settings.pyxbase_codec is mutually exclusive with c_encoder/c_decoderbit varying bytescannot alias cannot close prepared statement; refs == {} != 0cannot decode type \"{}\".\"{}\": text encoding of range types is not supportedcannot decode type \"{}\".\"{}\": text encoding of composite types is not supportedcannot perform operation: another operation is cancellingcannot perform operation: another operation is in progresscannot perform operation: connection is closedcannot process message cannot register core codec for OID {}: it is greater than MAXSUPPORTEDOID ({})cannot switch to \"idle\" state; protocol is in the \"failed\" statecannot switch to state {}; another operation ({}) is in progresscannot switch to state {}; protocol is in the \"failed\" statecharacter varying codec for co""nnection was closed in the middle of operationcould not get iterationscould not get noncecould not get saltcould not get server signaturecould not verify server signature for SCRAM authentciation: scram-sha-256_decode_row: statement is Nonedisabledouble precisionduplicate GSSAPI/SSPI authentication requestenableexpected 0, 1 or 2 elements in range (got {}): expected a sequence, got expected a sequence (got type {!r})gcgot result for unknown protocol state {}gssapi module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authentication in element #inconsistent sub-array dimensions at position {}input of anonymous composite types is not supportedinvalid array element: {}invalid array element at index {}: {}invalid data format: {}invalid `format` argument, expected {}, got {!r}invalid input for query argument invalid input in executemany() argument sequence element #invalid nonceinvalid timeout value: expected non-negative float (got {!r})isenabledlist, tuple or Range object expected (got type {})malformed array literal {!r}: {}missing ']' after array dimensionsmissing '=' after array dimensionsmissing array dimension valuemissing codec information for OID {}named prepared statements cannot be marked unpreparedno binary format encoder for type {} (OID {})no codec for composite attribute type no decoder for OID {}no decoder for composite type element in position {} of type OID {}no default __reduce__ due to non-trivial __cinit__no encoder for OID {}non-homogeneous arraynot connectednumber of array dimensions ({}) exceed the maximum expected ({}) of executemany() sequenceoid[]_on_result__prepare: statement is None_on_result: waiter is None_on_result: waiter is done_parse_data_msgs: first message is not \"D\"_parse_data_msgs: result is not a list, but {!r}pg_contrib.hstore: protocol is in an unexpected state query argument {!r} is not a valid element of composite type {}reader is not an asynchronous iterablescram-sha-256size of encoded mu""ltirange datum exceeds the maximum allowed specified array dimensions do not match array contentsspilib module not found; please install asyncpg[gssauth] to use asyncpg with Kerberos/GSSAPI/SSPI authenticationtext[]'text', 'binary' or 'tuple''text' or 'binary'text or binarythe number of columns in the result row ({}) is different from what was described ({})the number of query arguments cannot exceed 32767the server expects {x} argument{s} for this query, {y} {w} passed: there is no time with timezonetime without timezonetimestamp with timezonetimestamp without timezone to too many elements in array valuetoo many elements in composite type recordtoo many elements in multirange value(tree fragment){} type does not support the 'tuple' exchange formattype record missing base type for domain type record missing base type for range type record missing base type for multirange type record missing field types for composite unexpected NULL element in multirange valueunexpected array dimension size: {}unexpected array dimensions value: {}unexpected character {!r} at position {}unexpected codec type: {}unexpected data format: {}unexpected data type of composite type attribute {}: {!r}, expected {!r}unexpected end of stringunexpected error while performing authentication: unexpected exchange format: {}unexpected multirange size value: {}unexpected number of attributes of composite type: {}, expected {}unexpected trailing {} bytes in bufferunhandled standard data type unknown error in protocol implementationunsupported SASL Authentication methods requested by the server: {!r}unsupported authentication method requested by the server: {!r}utf-8waiter is not done while handling critical protocol erroryou need values from server to generate a client proofAF_UNIXARRAY_TYPESAUTHENTICATION_METHODSAUTH_METHOD_NAMEAsyncIterableAttributeBUILTIN_TYPE_NAME_MAPBUILTIN_TYPE_OID_MAPBaseProtocolBaseProtocol.__reduce_cython__BaseProtocol.__setstate_cython__BaseProtocol._create_future_fallbackBa""seProtocol._get_timeoutBaseProtocol._is_cancellingBaseProtocol._on_timeoutBaseProtocol._on_waiter_completedBaseProtocol._request_cancelBaseProtocol._wait_for_cancellationBaseProtocol.abortBaseProtocol.bindBaseProtocol.bind_executeBaseProtocol.bind_execute_manyBaseProtocol.closeBaseProtocol.close_portalBaseProtocol.close_statementBaseProtocol.connection_lostBaseProtocol.connection_madeBaseProtocol.copy_inBaseProtocol.copy_outBaseProtocol.data_receivedBaseProtocol.executeBaseProtocol.get_record_classBaseProtocol.get_server_pidBaseProtocol.get_settingsBaseProtocol.is_closedBaseProtocol.is_connectedBaseProtocol.pause_writingBaseProtocol.prepareBaseProtocol.queryBaseProtocol.resume_writingBaseProtocol.set_connectionCancelledErrorClientSecurityContextCodecCodecMapCodecMap.__reduce_cython__CodecMap.__setstate_cython__Codec.__reduce_cython__Codec.__setstate_cython__ConnectionDoesNotExistErrorConnectionSettingsConnectionSettings.__reduce_cython__ConnectionSettings.__setstate_cython__ConnectionSettings.add_python_codecConnectionSettings.clear_type_cacheConnectionSettings.get_data_codecConnectionSettings.get_text_codecConnectionSettings.register_data_typesConnectionSettings.remove_python_codecConnectionSettings.set_builtin_type_codecCoreProtocolCoreProtocol.__reduce_cython__CoreProtocol.__setstate_cython__CoreProtocol.is_in_transactionDEFAULT_CLIENT_NONCE_BYTESDIGESTDataCodecConfigDataCodecConfig.__reduce_cython__DataCodecConfig.__setstate_cython__DataCodecConfig._set_builtin_type_codecDataCodecConfig.add_python_codecDataCodecConfig.add_typesDataCodecConfig.clear_type_cacheDataCodecConfig.declare_fallback_codecDataCodecConfig.remove_python_codecDataCodecConfig.set_builtin_type_codecDataErrorENCODINGS_MAPEventFLUSH_MESSAGEFutureIPPROTO_TCPInterfaceErrorInternalClientErrorIterableIterableABCKerberosMappingMappingABCNANFKCNO_TIMEOUTNameNameTypeNegotiateOrderedDictOutdatedSchemaCacheErrorPostgresErrorPreparedStatementStatePreparedStatementState.__reduce_cython__PreparedStatementSt""ate.__setstate_cython__PreparedStatementState._get_attributesPreparedStatementState._get_parametersPreparedStatementState._init_codecsPreparedStatementState._init_typesPreparedStatementState.attachPreparedStatementState.detachPreparedStatementState.mark_closedPreparedStatementState.mark_unpreparedProtocolProtocolError__Pyx_PyDict_NextRefREQUIREMENTS_CLIENT_FINAL_MESSAGEREQUIREMENTS_CLIENT_PROOFROLLBACKRangeRecordRecordDescriptorSASLPREP_PROHIBITEDSCRAMAuthenticationSCRAMAuthentication.__reduce_cython__SCRAMAuthentication.__setstate_cython__SCRAMAuthentication._bytes_xor.<locals>.genexprSCRAMAuthentication._normalize_password.<locals>.genexprSYNC_MESSAGESecurityContextSequenceSequenceABCSizedSizedABCStopAsyncIterationTCP_NODELAYTimeoutErrorTimerTimer.__enter__Timer.__exit__Timer.__init__Timer.get_remaining_budgetTimer.has_budget_greater_thanTypeUnsupportedClientFeatureErrorUserCredential_a_iabcabortabstimeaclitemadd_done_callbackadd_python_codecadd_typesaddr__aiter__aiteralias_oidalias_toaltamount__anext____annotate__anyanyarrayanycompatibleanycompatiblearrayanycompatiblemultirangeanycompatiblenonarrayanycompatiblerangeanyelementanyenumanymultirangeanynonarrayanyrangeapg_excapg_exc_baseapg_typesarg_bufsargsargs_bufarrayarray_element_oidasciiasyncioasyncio.coroutinesasyncpgasyncpg.exceptionsasyncpg.protocol.protocolasyncpg.protocol.recordattachattrnameattrnamesattrtypoidsauth_msgauthentication_method__await__bb64decodeb64encodeb_i_basebase64base_codecbase_typebasetypebasetype_namebigbigintbinarybindbind_executebind_execute_manybind_execute_many.<locals>.genexprbitboolboxbpcharbudget_budgetbufferbuiltinsbyteabyteordercc_decoderc_encodercall_exception_handlercall_latercancel_cancel_current_commandcancelled__cause__charcharacterchunkcidcidrcircle__class_getitem___cleanupclearclear_type_cacheclient_channel_bindingclient_encodingcline_in_tracebackcloseclose_portalclose_statementcodeccodec_mapcodec_setcodec_strcodecscollectionscollections.abccommand_timeoutcomp_elem_codecsc""omp_type_attrscompatcompositeconcon_params_configconnected_futconnectionconnection_lostconnection_madecopy_incopy_in.<locals>.<lambda>copy_outcopy_out.<locals>.<lambda>copy_stmtcore_codeccp1250cp1251cp1252cp1253cp1254cp1255cp1256cp1257cp1258cp1521cp866cp874cp932cp936cp949cp950create_future_create_future_fallback_create_recordcredentialcstringddatadata_gendata_receiveddata_typedatabasedatedecimaldeclare_fallback_codecdecodedecoderdescdetachdetail__dict___dictdigest__doc__doneeelemelem_codecelem_delimelem_formatelemdelimelement_nameselemselemtypeelemtype_nameemptyencodeencoder__enter__enumerateeteuc_cneuc_jis_2004euc_jpeuc_kreuccneucjpeuckrevent_triggerexexcexceptionexceptionsexecute__exit__ffamilyfdw_handlerfloat4float8fmtformatformats__func__futgenexprget_get_attributesget_data_codecget_extra_info_get_parametersget_record_classget_remaining_budgetget_server_pidget_settingsget_text_codec_get_timeout__getattribute____getstate__groupgssgssapigsslibgtsvectorhas_budget_greater_thanhas_text_elementshashlibhexdigesthinthmachostbased_serviceiignore_custom_codecin_prohibited_tablein_table_a1in_table_b1in_table_c12in_table_c21_c22in_table_c3in_table_c4in_table_c5in_table_c6in_table_c7in_table_c8in_table_c9in_table_d1in_table_d2index_am_handlerinet__init___init_codecs_init_typesinitiateintint2int4int8integerinternalinterval_is_cancellingis_closedis_connected_is_coroutineis_in_transactionisemptyitemitemsiteratorjsonjsonbjsonpathkerberosv5kindkoi8_rkoi8_ukoi8rkoi8ukrbsrvname<lambda>language_handlerlimitlinelookuplooplowerlower_inclsegmacaddrmacaddr8__main__make_recordmappingmark_closedmark_unpreparedmd5message__metaclass__missing__module__moneymonotonicmore__mro_entries__multirangename__name__new__new__nextnormalizensnum_colsnumericobjectoid_on_error_on_timeout_on_waiter_completedopaquep_oidpasswordpassword_iterationspassword_saltpathpause_readingpause_writingpg_brin_bloom_summarypg_brin_minmax_multi_summarypg_catalogpg_ddl_commandpg_dependenciespg_lsnpg_mcv_listpg_ndistinctpg_n""ode_treepg_snapshotpointpolygonpopportal_namepositionpostgresprepare__prepare___process_log_message_process_notificationprotocol__pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_BaseProtocol__pyx_unpickle_CoreProtocol__pyx_unpickle_DataCodecConfig__pyx_vtable____qualname__queryrangerange_subtyperange_subtype_namerange_subtype_oidrdescrereaderrealrecrecordrecord_classrecord_stmtrecords__reduce____reduce_cython____reduce_ex__refrefcursorregclassregcollationregconfigregdictionaryregister_data_typesregnamespaceregoperregoperatorregprocregprocedureregroleregtypereleasereltimeremove_python_codec_request_cancelresultresume_readingresume_writingreturn_extrareturn_rowsreversedrowsscalarschemasearchsecretsselfsendserver_first_messageserver_nonceserver_settingssetset_builtin_type_codec_set_builtin_type_codecset_connectionset_exception__set_name__set_resultsetdefaultsetsockopt__setstate____setstate_cython__settingssha256shift_jisshift_jis_2004sinksjissleepsmallintsmgrsocksocketsql_asciisspisspilib_startedstartswithstatestatus_msgstepstmt_namestrstringpreptable_am_handlertarget_codectarget_nametbtcvntcvn5712__test__textthrowtitidtimetimeouttimertimestamptimestamptztimetztintervalto_bytestoken_bytestransporttriggertsm_handlertsquerytsvectortupletxid_snapshottypeinfostypekindtypenametypeoidtypestypeschematypoidunicodeunicodedataunknownupdateupperupper_incusageuse_setstateuserutf_8uuidvaluevaluesvarbitvarcharvoidvsciiwwaitwait_for_wait_for_cancellationwaiterwaswbufweakrefwerewinwin1250win1251win1252win1253win1254win1255win1256win1257win1258win866win874win932win936win949win950windows1250windows1251windows1252windows1253windows1254windows1255windows1256windows1257windows1258windows866windows874windows932windows936windows949windows950with_msgwritewritelineswriting_allowedxxformatxidxid8xmlyzipClient KeyPGCOPY\n\377\r\n\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, PyObject *, char **, Py_ssize_t *)\000PyObject *(struct __pyx_obj_7asyncpg_7pgprot""o_7pgproto_CodecContext *, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *, PyObject *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *, struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000PyObject *(struct __pyx_t_7asyncpg_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)\000as_pg_string_and_size\000bits_encode\000bool_encode\000box_encode\000bytea_encode\000cidr_encode\000circle_encode\000date_encode\000date_encode_tuple\000float4_encode\000float8_encode\000hstore_encode\000inet_encode\000int2_encode\000int4_encode\000int8_encode\000interval_encode\000interval_encode_tuple\000jsonb_encode\000jsonpath_encode\000line_encode\000lseg_encode\000numeric_encode_binary\000numeric_encode_text\000path_encode\000pg_snapshot_encode\000point_encode\000poly_encode\000text_encode\000tid_encode\000time_encode\000time_encode_tuple\000timestamp_encode\000timestamp_encode_tuple\000timestamptz_encode\000timetz_encode\000timetz_encode_tuple\000uint4_encode\000uint8_encode\000uuid_encode\000void_encode\000bits_decode\000bool_decode\000box_decode\000bytea_decode\000cidr_decode\000circle_decode\000date_decode\000date_decode_tuple\000float4_decode\000float8_decode\000hstore_decode\000inet_decode\000int2_decode\000int4_decode\000int8_decode\000interval_decode\000interval_decode_tuple\000jsonb_decode\000jsonpath_decode\000line_decode\000lseg_decode\000numeric_decode_binary\000numeric_decode_text\000path_decode\000pg_snapshot_decode\000point_decode\000poly_decode\000text_decode\000tid_decode\000time_decode\000time_decode_tuple\000timestamp_decode\000timestamp_decode_tuple\000timestamptz_decode\000timetz_decode\000timetz_decode_tuple\000uint4_decode\000ui""nt8_decode\000uuid_decode\000void_decode\000frb_checkSCRAM-SHA-256Server Key\"\"\000,\000\000\000\001c=,c=,i=(\\d+),?\2401\260\032\2701\270J\300a\210!\34034\330*+\200\001\330\004*\250!\2506\260\021\210A\200A\33001\330\010\014\320\014$\240A\240Y\250j\270\014\300A\330%/\250q\330\010\014\320\014\035\230Q\200A\33012\360\010\000\r\034\230=\250\001\250\021\330\014!\240\021\330\014\035\230Q\340\010\013\2107\220#\220Q\330\014\027\320\027)\250\021\340\014\027\220q\340\010\013\210:\220Q\220j\240\001\330\014\030\230\r\240Q\240a\340\014\030\320\030-\250T\260\021\260*\270A\340\010\014\210J\220a\330\014\017\210z\230\023\230A\330\020\037\230t\240:\250Q\250k\270\021\340\020\037\230\177\250a\250z\270\021\340\014\017\210}\230C\230q\330\020\021\340\014\024\220L\240\005\240Q\330\014\021\220\027\230\001\330\014\021\220\030\230\021\330\014\021\220\032\2301\330\014\021\220\030\230\021\340\014\020\320\020$\240A\240Y\250j\270\001\330\014\030\230\001\340\010\013\2104\210q\330\014\017\210w\220c\230\021\330\020\034\230A\330\021\030\230\003\2301\330\020\034\230A\340\020\034\230A\340\014\022\220*\230O\2501\330\020\037\230q\240\r\250Q\250a\330\020\037\320\0374\260A\260Q\200A\330\010\014\320\014!\240\021\330\010\014\320\014!\240\021\200A\330\010\013\2104\210q\330\014\022\220*\320\0340\260\001\330\020\021\330\010\014\210L\230\001\200A\330\010\013\2104\210q\330\014\r\330\010\014\210K\220q\330\010\014\320\014.\250a\250q\330\010\014\210K\220q\330\010\014\210J\220f\230A\330\010\014\210M\230\021\200A\330\010\013\2104\210q\330\014\020\220\017\230w\240a\330\014\020\320\020\"\240!\330\010\013\2104\210w\220d\230(\240#\240T\250\037\270\007\270q\330\014\r\330\010\013\2103\210j\230\001\330\014\020\320\020 \240\001\200A\360\006\000\t\014\2104\210s\220!\360\014\000\r\023\220*\320\034:\270!\330\020/\250q\260\r\270Q\270a\360\020\000\r\021\320\020(\250\001\250\025\250f\260H\270A\330)2\260!\340\014\024\220D\230\n\240!\2405\250\001\340\010\017\210q\200A\360\006\000\t\014\2104\210t\2201\330\014\023\2201\340\010\021""\220\021\330\010\014\210E\220\024\220Q\330\014\023\2201\220A\220Q\330\014\022\220!\2201\220A\340\014\024\220D\230\t\240\037\260\001\260\021\330\014\017\210v\220S\230\001\330\020\026\220j\320 4\260A\330\024:\270'\300\021\300!\340\014\023\2204\220w\230a\230t\2409\250A\340\014\022\220'\230\021\330\020\031\230\032\2401\240A\330\024\035\230U\240!\2405\250\005\250W\260E\270\027\300\005\300Q\340\010\017\210u\220A\220Q\200A\330\010\013\2104\210x\220w\230d\240#\240S\250\005\250S\260\001\330\020\024\220O\2407\250%\250q\330\020\024\320\024$\240C\240q\330\014\r\330\010\014\320\014\034\230A\330\010\014\210G\220>\240\021\240'\250\035\260a\200A\330\010\013\2104\210y\230\003\2301\340\014\023\2201\340\014\023\2204\220y\240\002\240!\200A\330\010\013\2104\210y\230\007\230q\330\014\020\220\014\230D\240\n\250!\200A\330\010\013\2104\210y\230\007\230q\330\014\020\220\014\230D\240\n\250#\250R\250t\2601\200A\360\n\000\t\014\2107\220#\220Q\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\340\014\022\220*\230O\2501\330\020B\300'\310\021\330\024*\250!\360\006\000\t\r\210M\320\0310\260\001\260\031\270*\300A\3301;\270:\300Q\200A\360\016\000\t\014\2107\220#\220Q\330\014\026\220a\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\014\026\220a\330\r\024\220C\220q\330\014\026\220a\330\014\026\220a\340\014\022\220*\230O\2501\330\020B\300'\310\021\330\0243\2601\360\006\000\t\r\210M\320\031*\250!\2509\260J\270a\330+5\260Q\330+4\260A\330+4\260A\200A\330\010\013\2108\2207\230!\330\014\r\330\020\023\2204\220q\230\t\240\023\240A\330\024\032\230!\330\020\032\230%\230q\240\001\330\023\024\330\020\026\220j\240\001\330\024\025\330 '\240q\250\017\260q\340\010\017\210t\320\023%\240Q\240a\200A\330\010\014\320\014\034\230D\240\001\200A\330\010\014\320\014\034\230F\240!\200A\360\022\000\t\r\210F\220!\330\014\022\220\"\220A\220Q\340\014\017\210t\220:\230Q\230e\240?\260'\270\021\330\020\021\340\014\023\2202\220Q\220a\330\014\025\220R\220q\230\001\330\014 \240\002\240!""\2401\330\014 \240\002\240!\2401\330\014\017\210r\220\021\220!\330\020\"\240%\240q\250\002\250!\2501\340\020\"\240!\330\014\030\230\002\230!\2301\340\014\017\210q\360\010\000\021\024\2204\220{\240!\2401\330\024\033\2304\230q\240\001\330\020\027\220v\230W\240A\240Q\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030+\2502\250Q\320.@\300\001\340\020\035\230Y\240b\250\001\250\034\260Q\260a\340\020\024\320\024)\250\021\250%\250z\270\021\330\031)\250\021\330\030\035\230V\2408\250<\260q\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030H\310\001\310\021\340\020#\2401\330\020$\240A\340\020\024\220J\230a\330\024!\240\024\240Z\250q\260\010\270\001\330\024\027\220{\240#\240Q\330\030\036\230j\320(<\270A\330\034D\300A\300Q\330\024\027\220z\240\030\250\023\250A\330\030,\250A\330\024$\240G\2501\250A\340\020 \240\013\250<\260q\330\020\024\220C\220|\2409\250A\250R\250q\260\001\330\024!\240\021\240,\250a\360\010\000\021\024\2201\330\024\"\240!\340\024\"\240!\340\020\024\320\024)\250\021\250%\250q\330\031-\250Q\330\030\035\230V\2408\250=\270\001\330\030)\250\021\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030C\3001\300A\340\020\035\230T\240\032\2501\250K\260q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030#\2402\240Q\320&8\270\001\340\020\024\320\024)\250\021\250%\250z\270\033\300A\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030B\300!\3001\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A\330\030+\2502\250Q\320.E\300Q\340\020\024\320\024)\250\021\250%\250z\270\021\330\031)\250\021\250%\250v\260X\270Q\340\021\023\2201\220H\230C\230q\360\006\000\021\024\2204\220q\330\024\032\230*\320$8\270\001\330\030G\300q\310\001\340\020\035\230T\240\032\2501\320,?\270q\330\020\023\220;\230c\240\021\330\024!\240\024\320%<\270A""\330\030+\2502\250Q\320.E\300Q\340\020\024\320\024)\250\021\250%\250z\270\021\330\031.\250a\250u\260F\270(\300!\340\021\023\2201\220H\230C\230q\340\020\024\320\024,\250A\250U\260&\270\010\300\001\330-6\260a\340\020\024\320\024+\2501\250E\260\026\260q\200A\330\010\014\210G\2201\320\024&\240a\330\014\020\320\020$\240D\250\002\250)\2606\270\021\330\010\014\320\014\035\230Q\200A\360\006\000\t\022\220\021\330\010\014\210G\2204\220q\330\014\024\220D\230\t\240\037\260\001\260\021\330\014\017\210v\220S\230\001\330\020\026\220j\320 4\260A\330\024:\270'\300\021\300!\330\014\022\220'\230\021\230)\2405\250\001\330\020\025\220U\230'\240\025\240g\250U\260!\340\010\017\210u\220A\220Q\200A\330\010\014\210G\220:\230Q\230a\330\010\014\320\014\"\240!\200A\330\010\014\210I\220Q\200A\330\010\014\210J\220a\200A\330\010\014\210J\220g\230T\240\021\240!\200A\330\010\014\210K\220q\330\010\014\210L\230\001\200A\330\010\014\210M\320\031*\250!\200A\330\010\014\210M\230\032\2401\240A\200A\330\010\014\210M\320\031-\250Q\250i\260z\300\021\200A\330\010\014\210M\230\021\340\010\017\210y\230\017\240q\250\001\330\010\014\210E\220\027\230\005\230Q\330\017\023\2207\230!\2308\2401\330\017\022\220$\220h\230c\240\026\240q\330\014\020\220\013\2301\230F\240!\330\034\"\240.\260\001\340\010\t\330\014\020\220\t\230\021\330\010\017\210}\230A\330\014\025\220V\2301\330\014\020\220\016\230a\330\014\020\220\013\2301\230A\330\014\020\220\n\230!\2301\200A\330\010\014\210N\230!\330\010\014\210K\220q\230\001\330\010\014\320\014 \240\001\240\021\200A\360\006\000\r\036\230Q\340\010\013\2104\210q\330\014\020\220\t\230\024\230Q\330\020\030\230\004\230I\240_\260A\260Z\270q\330\020\023\2206\230\023\230E\240\023\240D\250\005\250\\\270\021\330\024\033\2304\230q\240\001\340\010\013\2104\210q\330\014\020\220\t\230\024\230Q\330\020\030\230\004\230I\240_\260A\260[\300\005\300Q\300a\330\020\023\2206\230\023\230E\240\023\240D\250\005\250\\\270\021\330\024\033\2304\230q\240\005\240Q\240a\340\010\017\210q\200A\330\010\014\320\014\035""\230T\240\036\250q\330\010\014\320\014\"\240$\240n\260A\340\010\016\210d\220/\240\021\330\010\013\2104\210w\220a\360\006\000\r\020\320\017'\240q\250\004\250A\340\014\020\220\005\320\025,\250A\330\020\033\2301\360\n\000\r\021\220\006\220a\340\010\013\2104\210w\220c\230\021\360\014\000\r\021\220\007\220q\230\001\330\010\014\210K\220q\230\001\200A\330\010\014\320\014!\240\026\240q\200A\360\006\000\r \230q\330\014$\240A\330\014$\240A\330\014\037\230q\330\014\033\230=\250\001\250\021\330\014\035\230Q\360\006\000\t\r\320\014 \240\001\240\031\250*\260A\340\010\013\2101\330\014\020\220\n\230!\2301\340\010\013\2107\220#\220Q\330\014\027\320\027'\240q\340\014\027\220q\340\010\014\210G\2201\330\014\017\210x\220s\230!\330\020\023\2209\230C\230q\330\024!\240\036\250q\260\005\260U\270!\330\024\027\220{\240#\240Q\330\030\031\330\024 \240\n\250!\330\024 \240\n\250!\330\025\036\230c\240\021\330\024!\240\024\240Z\250q\260\005\260Q\330\024\027\220{\240#\240Q\330\030\031\340\014\020\320\020$\240A\240Y\250a\330\025&\240a\240u\250J\260l\300!\330'0\260\t\270\033\300A\330'3\2605\270\001\330\014\030\230\001\340\010\013\2104\210q\330\014\022\220*\230O\2501\330\020F\300g\310Q\330\024\025\200A\330\010\017\210t\2201\200A\330\010\017\210t\2204\220y\240\004\240D\250\014\260C\260q\200A\330>?\330?@\330\010\017\210t\220=\240\n\250!\2505\260\010\270\001\200A\360\006\000\t\020\210t\220=\240\004\320$5\260Q\200A\330\010\t\330\014\020\220\017\230w\240e\2501\330\014\020\320\020$\240G\2501\200A\330\010\017\210w\220g\230Q\230e\2404\240q\240Q\200\001\330\004\n\210+\220Q\200\001\330\004-\250Q\250f\260A\200\001\360\010\000\005\016\210T\320\021!\240\024\320%5\260T\3209P\320PT\320Ti\320im\320m}\360\000\000~\001B\002\360\000\000B\002L\002\360\000\000L\002P\002\360\000\000P\002^\002\360\000\000^\002b\002\360\000\000b\002s\002\360\000\000s\002w\002\360\000\000w\002@\003\360\000\000@\003D\003\360\000\000D\003Q\003\360\000\000Q\003U\003\360\000\000U\003b\003\360\000\000b\003f\003\360\000\000f\003q\003\360\000\000q""\003u\003\360\000\000u\003\177\003\360\000\000\177\003C\004\360\000\000C\004L\004\360\000\000L\004P\004\360\000\000P\004k\004\360\000\000k\004o\004\360\000\000o\004C\005\360\000\000C\005G\005\360\000\000G\005Y\005\360\000\000Y\005]\005\360\000\000]\005q\005\360\000\000q\005u\005\360\000\000u\005C\006\360\000\000C\006G\006\360\000\000G\006O\006\360\000\000O\006S\006\360\000\000S\006[\006\360\000\000[\006_\006\360\000\000_\006k\006\360\000\000k\006o\006\360\000\000o\006p\006\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\230?\250'\260\025\260c\270\024\320=S\320SZ\320Z_\320_b\320bf\320fz\360\000\000{\001B\002\360\000\000B\002G\002\360\000\000G\002J\002\360\000\000J\002N\002\360\000\000N\002W\002\360\000\000W\002^\002\360\000\000^\002c\002\360\000\000c\002f\002\360\000\000f\002j\002\360\000\000j\002r\002\360\000\000r\002y\002\360\000\000y\002~\002\360\000\000~\002A\003\360\000\000A\003E\003\360\000\000E\003Q\003\360\000\000Q\003X\003\360\000\000X\003]\003\360\000\000]\003`\003\360\000\000`\003d\003\360\000\000d\003n\003\360\000\000n\003u\003\360\000\000u\003z\003\360\000\000z\003}\003\360\000\000}\003A\004\360\000\000A\004J\004\360\000\000J\004Q\004\360\000\000Q\004V\004\360\000\000V\004Y\004\360\000\000Y\004]\004\360\000\000]\004e\004\360\000\000e\004l\004\360\000\000l\004q\004\360\000\000q\004t\004\360\000\000t\004x\004\360\000\000x\004K\005\360\000\000K\005R\005\360\000\000R\005W\005\360\000\000W\005Z\005\360\000\000Z\005^\005\360\000\000^\005o\005\360\000\000o\005v\005\360\000\000v\005{\005\360\000\000{\005~\005\360\000\000~\005B\006\360\000\000B\006U\006\360\000\000U\006\\\006\360\000\000\\\006a\006\360\000\000a\006d\006\360\000\000d\006h\006\360\000\000h\006o\006\360\000\000o\006v\006\360\000\000v\006{\006\360\000\000{\006~\006\360\000\000~\006B\007\360\000\000B\007M\007\360\000\000M\007T\007\360\000\000T\007U\007\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G""\3101\340\010\017\320\017-\250T\260\021\260'\270\033\300A\200\001\360\010\000\005\016\210T\320\021!\240\024\320%5\260T\3209P\320PT\320Ti\320im\320mw\320w{\360\000\000|\001L\002\360\000\000L\002P\002\360\000\000P\002Z\002\360\000\000Z\002^\002\360\000\000^\002l\002\360\000\000l\002p\002\360\000\000p\002A\003\360\000\000A\003E\003\360\000\000E\003N\003\360\000\000N\003R\003\360\000\000R\003g\003\360\000\000g\003k\003\360\000\000k\003{\003\360\000\000{\003\177\003\360\000\000\177\003I\004\360\000\000I\004M\004\360\000\000M\004Z\004\360\000\000Z\004^\004\360\000\000^\004k\004\360\000\000k\004o\004\360\000\000o\004x\004\360\000\000x\004|\004\360\000\000|\004L\005\360\000\000L\005P\005\360\000\000P\005[\005\360\000\000[\005_\005\360\000\000_\005i\005\360\000\000i\005m\005\360\000\000m\005z\005\360\000\000z\005~\005\360\000\000~\005K\006\360\000\000K\006O\006\360\000\000O\006V\006\360\000\000V\006Z\006\360\000\000Z\006j\006\360\000\000j\006n\006\360\000\000n\006}\006\360\000\000}\006A\007\360\000\000A\007J\007\360\000\000J\007N\007\360\000\000N\007i\007\360\000\000i\007m\007\360\000\000m\007A\010\360\000\000A\010E\010\360\000\000E\010W\010\360\000\000W\010[\010\360\000\000[\010o\010\360\000\000o\010s\010\360\000\000s\010A\t\360\000\000A\tE\t\360\000\000E\tT\t\360\000\000T\tX\t\360\000\000X\t`\t\360\000\000`\td\t\360\000\000d\to\t\360\000\000o\ts\t\360\000\000s\t{\t\360\000\000{\t\177\t\360\000\000\177\tK\n\360\000\000K\nO\n\360\000\000O\n`\n\360\000\000`\nd\n\360\000\000d\np\n\360\000\000p\nt\n\360\000\000t\n}\n\360\000\000}\nA\013\360\000\000A\013R\013\360\000\000R\013V\013\360\000\000V\013W\013\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\230?\250'\260\025\260c\270\024\320=S\320SZ\320Z_\320_b\320bf\320fz\360\000\000{\001B\002\360\000\000B\002G\002\360\000\000G\002J\002\360\000\000J\002N\002\360\000\000N\002W\002\360\000\000W\002^\002\360\000\000^\002c\002\360\000\000c\002f\002\360\000\000f""\002j\002\360\000\000j\002r\002\360\000\000r\002y\002\360\000\000y\002~\002\360\000\000~\002A\003\360\000\000A\003E\003\360\000\000E\003Y\003\360\000\000Y\003`\003\360\000\000`\003e\003\360\000\000e\003h\003\360\000\000h\003l\003\360\000\000l\003{\003\360\000\000{\003B\004\360\000\000B\004G\004\360\000\000G\004J\004\360\000\000J\004N\004\360\000\000N\004Z\004\360\000\000Z\004a\004\360\000\000a\004f\004\360\000\000f\004i\004\360\000\000i\004m\004\360\000\000m\004u\004\360\000\000u\004|\004\360\000\000|\004A\005\360\000\000A\005D\005\360\000\000D\005H\005\360\000\000H\005W\005\360\000\000W\005^\005\360\000\000^\005c\005\360\000\000c\005f\005\360\000\000f\005j\005\360\000\000j\005t\005\360\000\000t\005{\005\360\000\000{\005@\006\360\000\000@\006C\006\360\000\000C\006G\006\360\000\000G\006P\006\360\000\000P\006W\006\360\000\000W\006\\\006\360\000\000\\\006_\006\360\000\000_\006c\006\360\000\000c\006o\006\360\000\000o\006v\006\360\000\000v\006{\006\360\000\000{\006~\006\360\000\000~\006B\007\360\000\000B\007H\007\360\000\000H\007O\007\360\000\000O\007T\007\360\000\000T\007W\007\360\000\000W\007[\007\360\000\000[\007i\007\360\000\000i\007p\007\360\000\000p\007u\007\360\000\000u\007x\007\360\000\000x\007|\007\360\000\000|\007D\010\360\000\000D\010K\010\360\000\000K\010P\010\360\000\000P\010S\010\360\000\000S\010W\010\360\000\000W\010j\010\360\000\000j\010q\010\360\000\000q\010v\010\360\000\000v\010y\010\360\000\000y\010}\010\360\000\000}\010N\t\360\000\000N\tU\t\360\000\000U\tZ\t\360\000\000Z\t]\t\360\000\000]\ta\t\360\000\000a\tt\t\360\000\000t\t{\t\360\000\000{\t@\n\360\000\000@\nC\n\360\000\000C\nG\n\360\000\000G\nN\n\360\000\000N\nU\n\360\000\000U\nZ\n\360\000\000Z\n]\n\360\000\000]\na\n\360\000\000a\nk\n\360\000\000k\nr\n\360\000\000r\nw\n\360\000\000w\nz\n\360\000\000z\n~\n\360\000\000~\nI\013\360\000\000I\013P\013\360\000\000P\013U\013\360\000\000U\013X\013\360\000\000X\013\\\013\360\000\000\\\013l\013\360\000\000l\013s\013\360\000\000s\013x\013\360\000\000x\013{""\013\360\000\000{\013\177\013\360\000\000\177\013J\014\360\000\000J\014Q\014\360\000\000Q\014V\014\360\000\000V\014Y\014\360\000\000Y\014]\014\360\000\000]\014e\014\360\000\000e\014l\014\360\000\000l\014m\014\330\004\007\200q\330\010\017\320\017-\250T\260\021\260'\270\033\300G\3101\340\010\017\320\017-\250T\260\021\260'\270\033\300A\200\001\360\010\000\005\016\210T\320\021'\240t\2501\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\320\0330\260\007\260u\270C\270t\320CY\320Y`\320`a\330\004\007\200q\330\010\017\320\0170\260\004\260A\260W\270K\300w\310a\340\010\017\320\0170\260\004\260A\260W\270K\300q\240Z\250q\260\n\270!\230\021\210!\340\017\020\340\025\026\330\017\020\330\026\027\250!\210!\340\017\020\340\025\026\340\025\026\210!\240a\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220?\240(\250!\2501\330\004\007\200|\2207\230!\330\0101\260\021\3202D\300N\320RS\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220<\230x\240q\250\001\330\004\007\200|\2207\230!\330\010.\250a\250\177\270n\310A\330\004\013\2101\200\001\360\016\000\005\010\200x\210s\220!\330\010\017\320\017\037\230q\240\004\240A\340\010\017\320\017\037\230q\330\014\025\220U\230!\230<\240}\260A\340\004\n\210$\210l\230!\2308\2403\240a\240q\330\004\010\210\005\210U\220!\2203\220a\220q\330\010\017\210u\220A\220Q\330\017\031\230\021\230!\330\022%\240Q\240e\2503\250a\330\004\013\2101n,,n=,p=,r=r=([^,]+),,s=([^,]+),v=([^,]+)NULLcclient_encodingdemmd5r";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 848; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 158) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 848; i < 937; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 937; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 848;
      for (Py_ssize_t i=0; i<89; ++i) {
        #if PY_VERSION_HEX >= 0x030F0000
        PyUnstable_SetImmortal(table[i]);
        #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
        }
        #else
        if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
    int8_t const cint_constants_1[] = {0,1,4,6,16,17,18,19,20,21,23,24,25,26,27,28,29,32,114};
    int16_t const cint_constants_2[] = {142,194,210,269,325,600,601,602,603,604,628,650,700,701,702,703,704,705,718,774,790,829,869,1009,1028,1033,1042,1043,1082,1083,1114,1184,1186,1266,1560,1562,1700,1790,2202,2203,2204,2205,2206,2249,2275,2276,2277,2278,2279,2280,2281,2282,2283,2776,2950,2970,3115,3220,3310,3361,3402,3500,3614,3615,3642,3734,3769,3802,3831,3838,4072,4089,4096,4191,4537,4538,4600,4601,5017,5038,5069,5077,5078,5079,5080};
    int32_t const cint_constants_4[] = {32768L,524288L,134522893L,175807176L,228230485L};
    for (int i = 0; i < 109; i++) {
      numbertab[i] = PyLong_FromLong((i < 19 ? cint_constants_1[i - 0] : (i < 104 ? cint_constants_2[i - 19] : cint_constants_4[i - 104])));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<109; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 4;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 2;
    unsigned int nlocals : 5;
    unsigned int flags : 10;
    unsigned int first_line : 11;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 188};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_a_i, __pyx_mstate->__pyx_n_u_b_i};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 287};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_in_prohibited_table};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 327};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 336};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_scram_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 3, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stmt_name, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_ignore_custom_codec, __pyx_mstate->__pyx_n_u_record_class, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_prepare, __pyx_mstate->__pyx_kp_b_iso88591_34, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 167};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_return_extra, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_args_buf, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind_execute, __pyx_mstate->__pyx_kp_b_iso88591__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 228};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__28, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 207};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_return_rows, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_data_gen, __pyx_mstate->__pyx_n_u_arg_bufs, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_more, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_ex, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind_execute_many, __pyx_mstate->__pyx_kp_b_iso88591__29, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 268};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_args_buf, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_bind, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 296};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_return_extra, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_execute, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 325};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_portal_name, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close_portal, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 347};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 371};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy_stmt, __pyx_mstate->__pyx_n_u_sink, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_done, __pyx_mstate->__pyx_n_u_status_msg, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_copy_out, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 410};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_1Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 424};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy_stmt, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_records, __pyx_mstate->__pyx_n_u_record_stmt, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_wbuf, __pyx_mstate->__pyx_n_u_num_cols, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_timer, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_codecs, __pyx_mstate->__pyx_n_u_settings, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_aiter_2, __pyx_mstate->__pyx_n_u_iterator, __pyx_mstate->__pyx_n_u_chunk, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_status_msg};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_copy_in, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 553};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 562};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_waiter, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close_statement, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 602};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timeout};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_close, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_wait_for_cancellation, __pyx_mstate->__pyx_kp_b_iso88591__30, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_get_text_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_types};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_register_data_types, __pyx_mstate->__pyx_kp_b_iso88591_A_M_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typeinfos, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_encoder, __pyx_mstate->__pyx_n_u_decoder, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_add_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_7_Q_a_a_Cq_a_a_Cq_a_a_O1_B_31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_remove_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_M_Qiz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_clear_type_cache, __pyx_mstate->__pyx_kp_b_iso88591_A_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_7_Q_a_Cq_a_Cq_a_O1_B_M_0_A1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_ignore_custom_codec};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_settings_pyx, __pyx_mstate->__pyx_n_u_get_data_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_t_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 517};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_types, __pyx_mstate->__pyx_n_u_elem_codec, __pyx_mstate->__pyx_n_u_comp_elem_codecs, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_elem_format, __pyx_mstate->__pyx_n_u_has_text_elements, __pyx_mstate->__pyx_n_u_elem_delim, __pyx_mstate->__pyx_n_u_ti, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_array_element_oid, __pyx_mstate->__pyx_n_u_range_subtype_oid, __pyx_mstate->__pyx_n_u_comp_type_attrs, __pyx_mstate->__pyx_n_u_base_type, __pyx_mstate->__pyx_n_u_typoid, __pyx_mstate->__pyx_n_u_element_names, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_attrname};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_add_types, __pyx_mstate->__pyx_kp_b_iso88591_A_F_AQ_t_Qe_2Qa_Rq_1_1_r_q_1_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 647};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_typeinfos, __pyx_mstate->__pyx_n_u_encoder, __pyx_mstate->__pyx_n_u_decoder, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_xformat, __pyx_mstate->__pyx_n_u_core_codec, __pyx_mstate->__pyx_n_u_c_encoder, __pyx_mstate->__pyx_n_u_c_decoder, __pyx_mstate->__pyx_n_u_base_codec, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_codec_set, __pyx_mstate->__pyx_n_u_formats, __pyx_mstate->__pyx_n_u_fmt};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_add_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_q_A_A_q_Q_A_1_1_7_Q_q_q_G1_xs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 692};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_fmt};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_remove_python_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_G1_a_D_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 697};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_target_codec, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_alias_oid, __pyx_mstate->__pyx_n_u_codec_set, __pyx_mstate->__pyx_n_u_formats, __pyx_mstate->__pyx_n_u_codec_str};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec_2, __pyx_mstate->__pyx_kp_b_iso88591_A12_Q_7_Q_q_Qj_Qa_T_A_Ja_z_A_t_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 746};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typeoid, __pyx_mstate->__pyx_n_u_typename, __pyx_mstate->__pyx_n_u_typeschema, __pyx_mstate->__pyx_n_u_typekind, __pyx_mstate->__pyx_n_u_alias_to, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_set_builtin_type_codec, __pyx_mstate->__pyx_kp_b_iso88591_A01_AYj_A_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 752};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_clear_type_cache, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_oid, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_codec};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_codecs_base_pyx, __pyx_mstate->__pyx_n_u_declare_fallback_codec, __pyx_mstate->__pyx_kp_b_iso88591_A_4s_q_Qa_fHA_2_D_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_t1_G1F_a_vWE_Q_q_t_0_uCtCYY_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_coreproto_pyx, __pyx_mstate->__pyx_n_u_is_in_transaction, __pyx_mstate->__pyx_kp_b_iso88591_A_t_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_5T9PPTTiimm_B_B_L_L_P_P_b_b_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_oid};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_get_parameters, __pyx_mstate->__pyx_kp_b_iso88591_A_G4q_D_vS_j_4A_5_U_gU_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_d, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_oid};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_get_attributes, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_1_E_Q_1AQ_1A_D_vS_j_4A_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 73};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_codec, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_p_oid, __pyx_mstate->__pyx_n_u_rdesc};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_init_types, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_4q_Q_I_AZq_6_E_D_4q_4q_Q_I_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_init_codecs, __pyx_mstate->__pyx_kp_b_iso88591_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 96};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_attach, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_detach, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 102};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_mark_closed, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_prepared_stmt_p, __pyx_mstate->__pyx_n_u_mark_unprepared, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_0_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 111};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_connection};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_set_connection, __pyx_mstate->__pyx_kp_b_iso88591_A_JgT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_server_pid, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_settings, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_record_class, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 587};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_closed, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 590};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_connected, __pyx_mstate->__pyx_kp_b_iso88591_A_t4y_D_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 593};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_abort, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_Kq_aq_Kq_JfA_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 642};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_con};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_request_cancel, __pyx_mstate->__pyx_kp_b_iso88591_A_T_q_nA_d_4wa_q_A_A_1_a_4wc_q_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 669};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fut};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_on_timeout, __pyx_mstate->__pyx_kp_b_iso88591_A_4xwd_S_S_O7_q_Cq_A_G_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 677};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fut};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_on_waiter_completed, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_wa_4wd_T_q_3j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 686};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_create_future_fallback, __pyx_mstate->__pyx_kp_b_iso88591_A_wgQe4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 702};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timeout};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_timeout, __pyx_mstate->__pyx_kp_b_iso88591_A_87_4q_A_q_j_q_q_t_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_is_cancelling, __pyx_mstate->__pyx_kp_b_iso88591_A_we1_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 963};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_data_received, __pyx_mstate->__pyx_kp_b_iso88591_A_G_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 967};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_transport, __pyx_mstate->__pyx_n_u_sock, __pyx_mstate->__pyx_n_u_ex};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_connection_made, __pyx_mstate->__pyx_kp_b_iso88591_A_M_y_q_E_Q_7_81_hc_q_1F_A_V1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 985};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_connection_lost, __pyx_mstate->__pyx_kp_b_iso88591_A_N_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 990};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_pause_writing, __pyx_mstate->__pyx_kp_b_iso88591_A_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 993};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_resume_writing, __pyx_mstate->__pyx_kp_b_iso88591_A_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_5T9PPTTiimmww_L_L_P_P_Z_Z_l_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1006};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_budget};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1010};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_q_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1014};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_et, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_tb};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_q_D_Rt1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1018};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_get_remaining_budget, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1021};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_amount};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_has_budget_greater_than, __pyx_mstate->__pyx_kp_b_iso88591_A_4y_1_1_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1033};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_mapping, __pyx_mstate->__pyx_n_u_elems, __pyx_mstate->__pyx_n_u_rec, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_desc, __pyx_mstate->__pyx_n_u_elem};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_asyncpg_protocol_protocol_pyx, __pyx_mstate->__pyx_n_u_create_record, __pyx_mstate->__pyx_kp_b_iso88591_xs_q_A_q_U_A_l_83aq_U_3aq_uAQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_DataCodecConfig, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_1_2DNRS_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_CoreProtocol, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_BaseProtocol, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_a_nA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Coroutine.init */
  if (likely(__pyx_Coroutine_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Coro_CheckExact.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedCoroType = PyObject_GetAttrString(typesModule, "CoroutineType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Generator.init */
  if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* PyDictVersioning (used by GetModuleGlobalName) */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyObjectCall (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall (used by PyObjectFastCallMethod) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by RejectKeywords) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* GetTopmostException (used by SaveResetException) */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* SliceObject */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyLong_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyLong_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* py_dict_pop_ignore */
static CYTHON_INLINE int __Pyx_PyDict_Pop_ignore(PyObject *d, PyObject *key, PyObject *default_value) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)
    int result = PyDict_Pop(d, key, NULL);
    CYTHON_UNUSED_VAR(default_value);
    return (unlikely(result == -1)) ? -1 : 0;
#else
    PyObject *value;
    CYTHON_UNUSED_VAR(default_value);
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    value = _PyDict_Pop(d, key, Py_None);
    #else
    value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key, Py_None);
    #endif
    if (unlikely(value == NULL))
        return -1;
    Py_DECREF(value);
    return 0;
#endif
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* CIntToDigits (used by CIntToPyUnicode) */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    Py_ssize_t padding_length = ulength - 1;
    if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) padding_length);
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= padding_length;
        memset(cpos, padding_char, (size_t) padding_length);
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, padding_length);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (uint32_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_uint32_t(uint32_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(uint32_t)*3+2];
    char *dpos, *end = digits + sizeof(uint32_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    uint32_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (uint32_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (uint32_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (uint32_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectCall2Args (used by CallUnboundCMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return PyLong_FromLong(-intval);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a - b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla - llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_SubtractObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) - (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_SubtractObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace);
}
#endif

/* RaiseUnboundLocalError */
static void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    long b;
    const PY_LONG_LONG lla = intval;
    PY_LONG_LONG llb;
    if (unlikely(__Pyx_PyLong_IsZero(op2))) {
        return __Pyx_NewRef(op1);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op2);
    const digit* digits = __Pyx_PyLong_Digits(op2);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
    if (likely(size == 1)) {
        b = (long) digits[0];
        if (!is_positive) b *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            case 3:
                if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                    b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
            case 4:
                if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                    b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) b *= -1;
                    goto calculate_long;
                } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                    llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                    if (!is_positive) llb *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddCObj(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long a = intval;
    double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddCObj(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        return __Pyx_Float___Pyx_PyLong_AddCObj(op2, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddCObj(op1, op2, inplace);
}
#endif

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (long) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (long) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* bytes_tailmatch */
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
                                         Py_ssize_t start, Py_ssize_t end, int direction) {
    char* self_ptr;
    Py_ssize_t self_len;
    char* sub_ptr;
    Py_ssize_t sub_len;
    int retval;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000
    PyObject *converted_arg = NULL;
    #else
    Py_buffer view;
    view.obj = NULL;
    #endif
    #if !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
    if (PyBytes_AsStringAndSize(self, &self_ptr, &self_len) == -1) return -1;
    #else
    self_ptr = PyBytes_AS_STRING(self);
    self_len = PyBytes_GET_SIZE(self);
    #endif
    if (PyBytes_Check(arg)) {
        #if !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
        if (PyBytes_AsStringAndSize(arg, &sub_ptr, &sub_len) == -1) return -1;
        #else
        sub_ptr = PyBytes_AS_STRING(arg);
        sub_len = PyBytes_GET_SIZE(arg);
        #endif
    }
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000
    else if (PyByteArray_Check(arg)) {
        sub_ptr = PyByteArray_AsString(arg);
        if (unlikely(!sub_ptr)) return -1;
        sub_len = PyByteArray_Size(arg);
        if (unlikely(sub_len < 0)) return -1;
    } else {
        PyObject *as_memoryview = PyMemoryView_FromObject(arg);
        if (!as_memoryview) return -1;
        Py_DECREF(as_memoryview);
        converted_arg = PyBytes_FromObject(arg);
        if (!converted_arg) return -1;
        if (PyBytes_AsStringAndSize(converted_arg, &sub_ptr, &sub_len) == -1) {
            Py_DECREF(converted_arg);
            return -1;
        }
    }
    #else // LIMITED_API >= 030B0000 or !LIMITED_API
    else {
        if (unlikely(PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) == -1))
            return -1;
        sub_ptr = (char*) view.buf;
        sub_len = view.len;
    }
    #endif
    if (end > self_len)
        end = self_len;
    else if (end < 0)
        end += self_len;
    if (end < 0)
        end = 0;
    if (start < 0)
        start += self_len;
    if (start < 0)
        start = 0;
    if (direction > 0) {
        if (end-sub_len > start)
            start = end - sub_len;
    }
    if (start + sub_len <= end)
        retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len);
    else
        retval = 0;
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030b0000
    Py_XDECREF(converted_arg);
    #else
    if (view.obj)
        PyBuffer_Release(&view);
    #endif
    return retval;
}
static int __Pyx_PyBytes_TailmatchTuple(PyObject* self, PyObject* substrings,
                                        Py_ssize_t start, Py_ssize_t end, int direction) {
    Py_ssize_t i, count = __Pyx_PyTuple_GET_SIZE(substrings);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(count < 0)) return -1;
    #endif
    for (i = 0; i < count; i++) {
        int result;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substrings, i),
                                               start, end, direction);
#else
        PyObject* sub = __Pyx_PySequence_ITEM(substrings, i);
        if (unlikely(!sub)) return -1;
        result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction);
        Py_DECREF(sub);
#endif
        if (result) {
            return result;
        }
    }
    return 0;
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
                                   Py_ssize_t start, Py_ssize_t end, int direction) {
    if (unlikely(PyTuple_Check(substr))) {
        return __Pyx_PyBytes_TailmatchTuple(self, substr, start, end, direction);
    }
    return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc, *new_exc;
    __Pyx_PyThreadState_declare
    int is_async_stopiteration = 0;
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    __Pyx_PyThreadState_assign
    cur_exc = __Pyx_PyErr_CurrentExceptionType();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else {
            return;
        }
    }
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(tb);
    new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        "generator raised StopIteration");
    if (!new_exc) {
        Py_XDECREF(val);
        return;
    }
    PyException_SetCause(new_exc, val); // steals ref to val
    PyErr_SetObject(PyExc_RuntimeError, new_exc);
    Py_DECREF(new_exc);
}

/* RaiseClosureNameError */
static void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)*3+2];
    char *dpos, *end = digits + sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* decode_c_bytes (used by decode_bytes) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* PyObjectCallNoArg (used by PyObjectCallMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod (used by PyObjectCallMethod0) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}
#endif

/* PyObjectCallMethod0 (used by dict_iter) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
#endif
}

/* RaiseNoneIterError (used by UnpackTupleError) */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError (used by UnpackTuple2) */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 (used by dict_iter) */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_AVOID_BORROWED_REFS
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_AVOID_BORROWED_REFS
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#else
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_AVOID_BORROWED_REFS
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
#if !CYTHON_AVOID_BORROWED_REFS
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    PyObject *key, *value;
    if (unlikely(orig_length != PyDict_Size(iter_obj))) {
        PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
        return -1;
    }
    if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
        return 0;
    }
    if (pitem) {
        PyObject* tuple = PyTuple_New(2);
        if (unlikely(!tuple)) {
            return -1;
        }
        Py_INCREF(key);
        Py_INCREF(value);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_AVOID_BORROWED_REFS
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        next_item = __Pyx_PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* IterNextPlain (used by IterNext) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* IterNext */
static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return NULL;
        __Pyx_PyErr_Clear();
        Py_INCREF(defval);
        return defval;
    }
    if (defval) {
        Py_INCREF(defval);
        return defval;
    }
    __Pyx_PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}
static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
    __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator));
    PyErr_Format(PyExc_TypeError,
        __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name);
    __Pyx_DECREF_TypeName(iterator_type_name);
}
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
#if !CYTHON_COMPILING_IN_LIMITED_API
    iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc);
    if (likely(iternext)) {
        next = iternext(iterator);
        if (likely(next))
            return next;
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
        if (unlikely(iternext == &_PyObject_NextNotImplemented))
            return NULL;
    #endif
    } else if (CYTHON_USE_TYPE_SLOTS) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    } else
#endif
    if (unlikely(!PyIter_Check(iterator))) {
        __Pyx_PyIter_Next_ErrorNoIterator(iterator);
        return NULL;
    } else {
        next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator);
        if (likely(next))
            return next;
    }
    return __Pyx_PyIter_Next2Default(defval);
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON
static int
__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared)
{
    if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared))
        return 0;
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000
    if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1)
        return 0;
#endif
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left, unsafe_shared)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#endif

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* PyUnicode_Substring */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
            PyObject* text, Py_ssize_t start, Py_ssize_t stop) {
    Py_ssize_t length;
    #if !CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
    #endif
    length = __Pyx_PyUnicode_GET_LENGTH(text);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(length < 0)) return NULL;
    #endif
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    if (stop <= start)
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
    if (start == 0 && stop == length)
        return __Pyx_NewRef(text);
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyUnicode_Substring(text, start, stop);
#else
    return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
        PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
#endif
}

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_mstate_global->__pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* RaiseKeywordRequired */
static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) {
    PyErr_Format(PyExc_TypeError,
        "%s() needs keyword-only argument %U", func_name, kw_name);
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : abi_module,
        spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CoroutineBase) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CoroutineBase) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyObjectCallMethod1 (used by CoroutineBase) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* ReturnWithStopIteration (used by CoroutineBase) */
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase (used by Coroutine) */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    retval = self->body(self, tstate, value);
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                goto propagate_exception;
            goto throw_here;
        }
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                size_t nargs = 1U + (val != NULL) + (tb != NULL);
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    if (gen->gi_weakreflist != NULL)
    #endif
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) {
    PyObject *frame;
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    return frame;
}
#endif
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self);
    frame = __Pyx__Coroutine_get_frame_locked(self);
    __Pyx_END_CRITICAL_SECTION();
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_weakreflist = NULL;
#endif
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state));
    gen->__pyx_pymonitoring_version = 0;
#endif
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    result = gen->is_running;
    gen->is_running = 1;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    assert(gen->is_running);
    gen->is_running = 0;
    __Pyx_END_CRITICAL_SECTION();
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
    result = gen->is_running;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Coroutine (used by CoroutineYieldFrom) */
static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
    PyObject_GC_UnTrack(self);
    Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
    __Pyx_PyHeapTypeObject_GC_Del(self);
}
static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)self, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(self->coroutine);
    return 0;
}
static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) {
    Py_CLEAR(self->coroutine);
    return 0;
}
static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) {
    return __Pyx_Generator_Next(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) {
    return __Pyx_Coroutine_Send(self->coroutine, value);
}
#if __PYX_HAS_PY_AM_SEND
static __Pyx_PySendResult __Pyx_CoroutineAwait_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    return __Pyx_Coroutine_AmSend(((__pyx_CoroutineAwaitObject*)self)->coroutine, value, retval);
}
#endif
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) {
    return __Pyx_Coroutine_Throw(self->coroutine, args);
}
static __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_Close(self->coroutine, &retval);
    Py_XDECREF(retval);
    return result;
}
static PyObject *__Pyx_CoroutineAwait_Close_Method(__pyx_CoroutineAwaitObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self->coroutine, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
    Py_INCREF(self);
    return self;
}
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_CoroutineAwait_no_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) {
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(args);
    CYTHON_UNUSED_VAR(kwargs);
    PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead");
    return NULL;
}
#endif
static PyMethodDef __pyx_CoroutineAwait_methods[] = {
    {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_CoroutineAwait_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyType_Slot __pyx_CoroutineAwaitType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CoroutineAwait_dealloc},
    {Py_tp_traverse, (void *)__Pyx_CoroutineAwait_traverse},
    {Py_tp_clear, (void *)__Pyx_CoroutineAwait_clear},
#if !CYTHON_COMPILING_IN_PYPY
    {Py_tp_new, (void *)__Pyx_CoroutineAwait_no_new},
#endif
    {Py_tp_methods, (void *)__pyx_CoroutineAwait_methods},
    {Py_tp_iter, (void *)__Pyx_CoroutineAwait_self},
    {Py_tp_iternext, (void *)__Pyx_CoroutineAwait_Next},
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_CoroutineAwait_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_CoroutineAwaitType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_CoroutineAwaitType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2 // backport
static __Pyx_PyAsyncMethodsStruct __pyx_CoroutineAwait_as_async;
#endif
static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
    __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_mstate_global->__pyx_CoroutineAwaitType);
    if (unlikely(!await)) return NULL;
    Py_INCREF(coroutine);
    await->coroutine = coroutine;
    PyObject_GC_Track(await);
    return (PyObject*)await;
}
static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
    if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) {
        PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine");
        return NULL;
    }
    return __Pyx__Coroutine_await(coroutine);
}
static PyMethodDef __pyx_Coroutine_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Coroutine_memberlist[] = {
    {"cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being awaited, or None")},
    {"cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Coroutine_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the coroutine"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the coroutine"), 0},
    {"cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the coroutine"), 0},
    {"cr_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CoroutineType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_am_await, (void *)&__Pyx_Coroutine_await},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_methods, (void *)__pyx_Coroutine_methods},
    {Py_tp_members, (void *)__pyx_Coroutine_memberlist},
    {Py_tp_getset, (void *)__pyx_Coroutine_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_CoroutineType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_WEAKREF |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_CoroutineType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async;
#endif
static int __pyx_Coroutine_init(PyObject *module) {
    __pyx_mstatetype *mstate;
    CYTHON_MAYBE_UNUSED_VAR(module);
    mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CoroutineType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CoroutineType_spec, NULL);
    if (unlikely(!mstate->__pyx_CoroutineType))
        return -1;
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineType, &__pyx_Coroutine_as_async, &__Pyx_Coroutine_AmSend);
#endif
#ifdef __Pyx_IterableCoroutine_USED
    if (unlikely(__pyx_IterableCoroutine_init(module) == -1))
        return -1;
#endif
    mstate->__pyx_CoroutineAwaitType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CoroutineAwaitType_spec, NULL);
    if (unlikely(!mstate->__pyx_CoroutineAwaitType))
        return -1;
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineAwaitType, &__pyx_CoroutineAwait_as_async, &__Pyx_CoroutineAwait_AmSend);
#endif
    return 0;
}

/* CoroutineSetYieldFrom (used by CoroutineYieldFrom) */
static void
__Pyx_Coroutine_Set_Owned_Yield_From(__pyx_CoroutineObject *gen, PyObject *yf) {
    assert (!gen->yieldfrom);
#if CYTHON_USE_AM_SEND
    assert (!gen->yieldfrom_am_send);
    #if PY_VERSION_HEX < 0x030A00F0
    if (__Pyx_PyType_HasFeature(Py_TYPE(yf), __Pyx_TPFLAGS_HAVE_AM_SEND))
    #endif
    {
        __Pyx_pyiter_sendfunc am_send;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
        am_send = __Pyx_PyObject_TryGetSubSlot(yf, tp_as_async, am_send, __Pyx_pyiter_sendfunc);
        #else
        __Pyx_PyAsyncMethodsStruct* tp_as_async = (__Pyx_PyAsyncMethodsStruct*) Py_TYPE(yf)->tp_as_async;
        am_send = tp_as_async ? tp_as_async->am_send : NULL;
        #endif
        if (likely(am_send)) {
            gen->yieldfrom_am_send = am_send;
        }
    }
#endif
    gen->yieldfrom = yf;
}

/* Coro_CheckExact (used by GetAwaitIter) */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyCoro_CheckExact(PyObject *o) {
    return (PyObject*)Py_TYPE(o) == __pyx_mstate_global->__Pyx_CachedCoroType;
}
#endif

/* GetAwaitIter (used by CoroutineYieldFrom) */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(o)) {
        return __Pyx_NewRef(o);
    }
#endif
    return __Pyx__Coroutine_GetAwaitableIter(o);
}
static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
#if (PY_VERSION_HEX < 0x030d0000 || defined(_PyErr_FormatFromCause)) && !CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(source));
    _PyErr_FormatFromCause(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
#else
    PyObject *exc, *val, *val2, *tb;
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(source));
    assert(PyErr_Occurred());
    PyErr_Fetch(&exc, &val, &tb);
    PyErr_NormalizeException(&exc, &val, &tb);
    if (tb != NULL) {
        PyException_SetTraceback(val, tb);
        Py_DECREF(tb);
    }
    Py_DECREF(exc);
    assert(!PyErr_Occurred());
    PyErr_Format(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
    PyErr_Fetch(&exc, &val2, &tb);
    PyErr_NormalizeException(&exc, &val2, &tb);
    Py_INCREF(val);
    PyException_SetCause(val2, val);
    PyException_SetContext(val2, val);
    PyErr_Restore(exc, val2, tb);
#endif
}
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
    PyObject *res;
    unaryfunc am_await;
    am_await = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_await, unaryfunc);
    if (likely(am_await)) {
        res = (*am_await)(obj);
    } else
#if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
#if PY_VERSION_HEX >= 0x030C00A6
    if (PyGen_CheckExact(obj) && (PyGen_GetCode((PyGenObject*)obj)->co_flags & CO_ITERABLE_COROUTINE)) {
#else
    if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
#endif
        return __Pyx_NewRef(obj);
    } else
#endif
    {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
        PyObject *args[] = { obj };
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_await, args, 1 |  PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
        if (unlikely(!res)) {
            if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyObject *type, *value, *traceback;
                PyErr_Fetch(&type, &value, &traceback);
                int has_attr = PyObject_HasAttr(obj, __pyx_mstate_global->__pyx_n_u_await);
                PyErr_Restore(type, value, traceback);
                if (!has_attr) goto slot_error;
            }
        }
#else
        PyObject *method = NULL;
        int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_mstate_global->__pyx_n_u_await, &method);
        if (likely(is_method)) {
            res = __Pyx_PyObject_CallOneArg(method, obj);
        } else if (likely(method)) {
            res = __Pyx_PyObject_CallNoArg(method);
        } else
            goto slot_error;
        Py_DECREF(method);
#endif
    }
    if (unlikely(!res)) {
        __Pyx_Coroutine_AwaitableIterError(obj);
        goto bad;
    }
    if (unlikely(!PyIter_Check(res))) {
        __Pyx_TypeName res_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(res));
        PyErr_Format(PyExc_TypeError,
            "__await__() returned non-iterator of type '" __Pyx_FMT_TYPENAME "'", res_type_name);
        __Pyx_DECREF_TypeName(res_type_name);
        Py_CLEAR(res);
    } else {
        int is_coroutine = 0;
        #ifdef __Pyx_Coroutine_USED
        is_coroutine |= __Pyx_Coroutine_Check(res);
        #endif
        is_coroutine |= __Pyx_PyCoro_CheckExact(res);
        if (unlikely(is_coroutine)) {
            /* __await__ must return an *iterator*, not
               a coroutine or another awaitable (see PEP 492) */
            PyErr_SetString(PyExc_TypeError,
                            "__await__() returned a coroutine");
            Py_CLEAR(res);
        }
    }
    return res;
slot_error:
    {
        __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
        PyErr_Format(PyExc_TypeError,
            "object " __Pyx_FMT_TYPENAME " can't be used in 'await' expression", obj_type_name);
        __Pyx_DECREF_TypeName(obj_type_name);
    }
bad:
    return NULL;
}

/* CoroutineYieldFrom */
  static __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Coroutine(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      __Pyx_PySendResult result;
      if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
          PyErr_SetString(
              PyExc_RuntimeError,
              "coroutine is being awaited already");
          return PYGEN_ERROR;
      }
      result = __Pyx_Coroutine_AmSend(source, Py_None, retval);
      if (result == PYGEN_NEXT) {
          Py_INCREF(source);
          __Pyx_Coroutine_Set_Owned_Yield_From(gen, source);
      }
      return result;
  }
  static __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      __Pyx_PySendResult result;
      PyObject *source_gen = NULL;
      source_gen = __Pyx_Coroutine_GetAwaitableIter(source);
      if (unlikely(!source_gen)) return PYGEN_ERROR;
      if (__Pyx_Coroutine_Check(source_gen)) {
          result = __Pyx_Coroutine_Yield_From_Coroutine(gen, source_gen, retval);
          Py_DECREF(source_gen);
          return result;
      }
      *retval = __Pyx_PyIter_Next_Plain(source_gen);
      if (*retval) {
          __Pyx_Coroutine_Set_Owned_Yield_From(gen, source_gen);
          return PYGEN_NEXT;
      }
      result = __Pyx_Coroutine_status_from_result(retval);
      Py_XDECREF(source_gen);
      return result;
  }
  static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      if (__Pyx_Coroutine_Check(source)) {
          return __Pyx_Coroutine_Yield_From_Coroutine(gen, source, retval);
      }
  #ifdef __Pyx_AsyncGen_USED
      if (__pyx_PyAsyncGenASend_CheckExact(source)) {
          *retval = __Pyx_async_gen_asend_iternext(source);
          if (*retval) {
              Py_INCREF(source);
              __Pyx_Coroutine_Set_Owned_Yield_From(gen, source);
              return PYGEN_NEXT;
          }
          return __Pyx_Coroutine_status_from_result(retval);
      }
  #endif
      return __Pyx_Coroutine_Yield_From_Generic(gen, source, retval);
  }
  
/* pybuiltin_invalid (used by pyint_simplify) */
  static void __Pyx_PyBuiltin_Invalid(PyObject *obj, const char *type_name, const char *argname) {
      __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
      if (argname) {
          PyErr_Format(PyExc_TypeError,
              "Argument '%.200s' has incorrect type (expected %.200s, got " __Pyx_FMT_TYPENAME ")",
              argname, type_name, obj_type_name
          );
      } else {
          PyErr_Format(PyExc_TypeError,
              "Expected %.200s, got " __Pyx_FMT_TYPENAME,
              type_name, obj_type_name
          );
      }
      __Pyx_DECREF_TypeName(obj_type_name);
  }
  
/* pyint_simplify */
  static CYTHON_INLINE int __Pyx_PyInt_FromNumber(PyObject **number_var, const char *argname, int accept_none) {
      PyObject *number = *number_var;
      if (likely((accept_none && number == Py_None) || PyLong_CheckExact(number))) {
          return 0;
      }
      PyObject *int_object;
      if (likely(PyNumber_Check(number))) {
          int_object = PyNumber_Long(number);
          if (unlikely(!int_object)) goto bad;
      } else {
          __Pyx_PyBuiltin_Invalid(number, "int", argname);
          goto bad;
      }
      *number_var = int_object;
      Py_DECREF(number);
      return 0;
  bad:
      *number_var = NULL;
      Py_DECREF(number);
      return -1;
  }
  
/* PyObjectLookupSpecial */
  #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
      PyObject *res;
      PyTypeObject *tp = Py_TYPE(obj);
      res = _PyType_Lookup(tp, attr_name);
      if (likely(res)) {
          descrgetfunc f = Py_TYPE(res)->tp_descr_get;
          if (!f) {
              Py_INCREF(res);
          } else {
              res = f(res, obj, (PyObject *)tp);
          }
      } else if (with_error) {
          PyErr_SetObject(PyExc_AttributeError, attr_name);
      }
      return res;
  }
  #endif
  
/* PyMethodNew (used by CythonFunctionShared) */
  #if CYTHON_COMPILING_IN_LIMITED_API
  static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
      PyObject *result;
      CYTHON_UNUSED_VAR(typ);
      if (!self)
          return __Pyx_NewRef(func);
      #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
      {
          PyObject *args[] = {func, self};
          result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
      }
      #else
      result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
      #endif
      return result;
  }
  #else
  static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
      CYTHON_UNUSED_VAR(typ);
      if (!self)
          return __Pyx_NewRef(func);
      return PyMethod_New(func, self);
  }
  #endif
  
/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
  #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  {
      PyObject *res = NULL;
      PyObject *kwnames;
      PyObject **newargs;
      PyObject **kwvalues;
      Py_ssize_t i;
      #if CYTHON_AVOID_BORROWED_REFS
      PyObject *pos;
      #else
      Py_ssize_t pos;
      #endif
      size_t j;
      PyObject *key, *value;
      unsigned long keys_are_strings;
      #if !CYTHON_ASSUME_SAFE_SIZE
      Py_ssize_t nkw = PyDict_Size(kw);
      if (unlikely(nkw == -1)) return NULL;
      #else
      Py_ssize_t nkw = PyDict_GET_SIZE(kw);
      #endif
      newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
      if (unlikely(newargs == NULL)) {
          PyErr_NoMemory();
          return NULL;
      }
      for (j = 0; j < nargs; j++) newargs[j] = args[j];
      kwnames = PyTuple_New(nkw);
      if (unlikely(kwnames == NULL)) {
          PyMem_Free(newargs);
          return NULL;
      }
      kwvalues = newargs + nargs;
      pos = 0;
      i = 0;
      keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
      while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
          keys_are_strings &=
          #if CYTHON_COMPILING_IN_LIMITED_API
              PyType_GetFlags(Py_TYPE(key));
          #else
              Py_TYPE(key)->tp_flags;
          #endif
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
          #else
          PyTuple_SET_ITEM(kwnames, i, key);
          #endif
          kwvalues[i] = value;
          i++;
      }
      if (unlikely(!keys_are_strings)) {
          PyErr_SetString(PyExc_TypeError, "keywords must be strings");
          goto cleanup;
      }
      res = vc(func, newargs, nargs, kwnames);
  cleanup:
      #if CYTHON_AVOID_BORROWED_REFS
      Py_DECREF(pos);
      #endif
      Py_DECREF(kwnames);
      for (i = 0; i < nkw; i++)
          Py_DECREF(kwvalues[i]);
      PyMem_Free(newargs);
      return res;
  }
  static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  {
      Py_ssize_t kw_size =
          likely(kw == NULL) ?
          0 :
  #if !CYTHON_ASSUME_SAFE_SIZE
          PyDict_Size(kw);
  #else
          PyDict_GET_SIZE(kw);
  #endif
      if (kw_size == 0) {
          return vc(func, args, nargs, NULL);
      }
  #if !CYTHON_ASSUME_SAFE_SIZE
      else if (unlikely(kw_size == -1)) {
          return NULL;
      }
  #endif
      return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
  }
  #endif
  
/* CythonFunctionShared (used by CythonFunction) */
  #if CYTHON_COMPILING_IN_LIMITED_API
  static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
      if (__Pyx_CyFunction_Check(func)) {
          return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
      } else if (PyCFunction_Check(func)) {
          return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
      }
      return 0;
  }
  static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
      if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
          int result;
          PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
          if (unlikely(!newFunc)) {
              PyErr_Clear(); // It's only an optimization, so don't throw an error
              return 0;
          }
          result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
          Py_DECREF(newFunc);
          return result;
      }
      return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
  }
  #else
  static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
      if (PyMethod_Check(func)) {
          func = PyMethod_GET_FUNCTION(func);
      }
      return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
  }
  #endif
  static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
  #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
      __Pyx_Py_XDECREF_SET(
          __Pyx_CyFunction_GetClassObj(f),
              ((classobj) ? __Pyx_NewRef(classobj) : NULL));
  #else
      __Pyx_Py_XDECREF_SET(
          ((PyCMethodObject *) (f))->mm_class,
          (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
  #endif
  }
  static PyObject *
  __Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
  {
      if (unlikely(op->func_doc == NULL)) {
  #if CYTHON_COMPILING_IN_LIMITED_API
          op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
          if (unlikely(!op->func_doc)) return NULL;
  #else
          if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
              op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
              if (unlikely(op->func_doc == NULL))
                  return NULL;
          } else {
              Py_INCREF(Py_None);
              return Py_None;
          }
  #endif
      }
      Py_INCREF(op->func_doc);
      return op->func_doc;
  }
  static PyObject *
  __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
      PyObject *result;
      CYTHON_UNUSED_VAR(closure);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      result = __Pyx_CyFunction_get_doc_locked(op);
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static int
  __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (value == NULL) {
          value = Py_None;
      }
      Py_INCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->func_doc, value);
      __Pyx_END_CRITICAL_SECTION();
      return 0;
  }
  static PyObject *
  __Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
  {
      if (unlikely(op->func_name == NULL)) {
  #if CYTHON_COMPILING_IN_LIMITED_API
          op->func_name = PyObject_GetAttrString(op->func, "__name__");
  #else
          op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
  #endif
          if (unlikely(op->func_name == NULL))
              return NULL;
      }
      Py_INCREF(op->func_name);
      return op->func_name;
  }
  static PyObject *
  __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
  {
      PyObject *result = NULL;
      CYTHON_UNUSED_VAR(context);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      result = __Pyx_CyFunction_get_name_locked(op);
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static int
  __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(value == NULL || !PyUnicode_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__name__ must be set to a string object");
          return -1;
      }
      Py_INCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->func_name, value);
      __Pyx_END_CRITICAL_SECTION();
      return 0;
  }
  static PyObject *
  __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      PyObject *result;
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      Py_INCREF(op->func_qualname);
      result = op->func_qualname;
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static int
  __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(value == NULL || !PyUnicode_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__qualname__ must be set to a string object");
          return -1;
      }
      Py_INCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->func_qualname, value);
      __Pyx_END_CRITICAL_SECTION();
      return 0;
  }
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  static PyObject *
  __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(op->func_dict == NULL)) {
          op->func_dict = PyDict_New();
          if (unlikely(op->func_dict == NULL))
              return NULL;
      }
      Py_INCREF(op->func_dict);
      return op->func_dict;
  }
  #endif
  static PyObject *
  __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      Py_INCREF(op->func_globals);
      return op->func_globals;
  }
  static PyObject *
  __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
  {
      CYTHON_UNUSED_VAR(op);
      CYTHON_UNUSED_VAR(context);
      Py_INCREF(Py_None);
      return Py_None;
  }
  static PyObject *
  __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
  {
      PyObject* result = (op->func_code) ? op->func_code : Py_None;
      CYTHON_UNUSED_VAR(context);
      Py_INCREF(result);
      return result;
  }
  static int
  __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
      int result = 0;
      PyObject *res = op->defaults_getter((PyObject *) op);
      if (unlikely(!res))
          return -1;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
      Py_INCREF(op->defaults_tuple);
      op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
      Py_INCREF(op->defaults_kwdict);
      #else
      op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
      if (unlikely(!op->defaults_tuple)) result = -1;
      else {
          op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
          if (unlikely(!op->defaults_kwdict)) result = -1;
      }
      #endif
      Py_DECREF(res);
      return result;
  }
  static int
  __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      if (!value) {
          value = Py_None;
      } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__defaults__ must be set to a tuple object");
          return -1;
      }
      PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                   "currently affect the values used in function calls", 1);
      Py_INCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
      __Pyx_END_CRITICAL_SECTION();
      return 0;
  }
  static PyObject *
  __Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
      PyObject* result = op->defaults_tuple;
      if (unlikely(!result)) {
          if (op->defaults_getter) {
              if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
              result = op->defaults_tuple;
          } else {
              result = Py_None;
          }
      }
      Py_INCREF(result);
      return result;
  }
  static PyObject *
  __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
      PyObject* result = NULL;
      CYTHON_UNUSED_VAR(context);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      result = __Pyx_CyFunction_get_defaults_locked(op);
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static int
  __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      if (!value) {
          value = Py_None;
      } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__kwdefaults__ must be set to a dict object");
          return -1;
      }
      PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                   "currently affect the values used in function calls", 1);
      Py_INCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
      __Pyx_END_CRITICAL_SECTION();
      return 0;
  }
  static PyObject *
  __Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
      PyObject* result = op->defaults_kwdict;
      if (unlikely(!result)) {
          if (op->defaults_getter) {
              if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
              result = op->defaults_kwdict;
          } else {
              result = Py_None;
          }
      }
      Py_INCREF(result);
      return result;
  }
  static PyObject *
  __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
      PyObject* result;
      CYTHON_UNUSED_VAR(context);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      result = __Pyx_CyFunction_get_kwdefaults_locked(op);
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
  static int
  __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      if (!value || value == Py_None) {
          value = NULL;
      } else if (unlikely(!PyDict_Check(value))) {
          PyErr_SetString(PyExc_TypeError,
                          "__annotations__ must be set to a dict object");
          return -1;
      }
      Py_XINCREF(value);
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      __Pyx_Py_XDECREF_SET(op->func_annotations, value);
      __Pyx_END_CRITICAL_SECTION();
      if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1;
      return 0;
  }
  static int
  __Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
      /* Return 1 if the function dict exists, 0 otherwise.  This cannot fail:
       * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
  #if CYTHON_COMPILING_IN_PYPY
      *dict = PyObject_GenericGetDict(op_in, NULL);
  #elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
      *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict;
  #else
      PyObject **dictptr = _PyObject_GetDictPtr(op_in);
      *dict = likely(dictptr) ? *dictptr : NULL;
  #endif
      return *dict ? 1 : 0;
  }
  static int
  __Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
      PyObject *dict;
      int dict_found;
      *annotate = NULL;
      dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
      if (!dict_found) return 0;
      return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
  }
  static int
  __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
      PyObject *dict;
      int dict_found;
      dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
      if (!dict_found) return 0;
      return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
  }
  static int
  __Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
      PyObject *dict;
      int result;
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL);
  #else
      dict = PyObject_GenericGetDict(op_in, NULL);
  #endif
      if (unlikely(!dict)) return -1;
      result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
      Py_DECREF(dict);
      return result;
  }
  static PyObject *
  __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
      PyObject* result = op->func_annotations;
      if (unlikely(!result)) {
          result = PyDict_New();
          if (unlikely(!result)) return NULL;
          op->func_annotations = result;
      }
      Py_INCREF(result);
      return result;
  }
  static PyObject *
  __Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
      PyObject *annotate = NULL;
      PyObject *result = NULL;
      __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
      CYTHON_UNUSED_VAR(context);
      __Pyx_BEGIN_CRITICAL_SECTION(op_in);
      result = __Pyx_XNewRef(op->func_annotations);
      __Pyx_END_CRITICAL_SECTION();
      if (result) return result;
      if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
      if (!annotate || annotate == Py_None) {
          Py_XDECREF(annotate);
          __Pyx_BEGIN_CRITICAL_SECTION(op_in);
          result = __Pyx_CyFunction_get_annotations_locked(op);
          __Pyx_END_CRITICAL_SECTION();
          return result;
      }
      PyObject *format = PyLong_FromLong(1L);  // annotationlib.Format.VALUE
      if (likely(format)) {
          result = __Pyx_PyObject_CallOneArg(annotate, format);
          Py_DECREF(format);
      }
      Py_DECREF(annotate);
      if (unlikely(!result)) return NULL;
      if (unlikely(!PyDict_Check(result))) {
          PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
          Py_DECREF(result);
          return NULL;
      }
      __Pyx_BEGIN_CRITICAL_SECTION(op_in);
      __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) {
      CYTHON_UNUSED_VAR(args);
      if (unlikely(!self)) {
          PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
      }
      Py_XINCREF(self);
      return self;
  }
  static PyMethodDef __Pyx_CyFunction_annotate_method = {
      "__annotate__",
      (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl,
      METH_VARARGS,
      "Placeholder __annotate__ function to allow 'functools.wraps' to work "
      "on Cython functions."
  };
  static PyObject *
  __Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
      PyObject *annotate = NULL;
      CYTHON_UNUSED_VAR(context);
      if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
      if (annotate) return annotate;
      PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL);
      if (unlikely(!annotations)) return NULL;
      PyObject *method = PyCFunction_New(
          &__Pyx_CyFunction_annotate_method,
          annotations);
      Py_DECREF(annotations);
      return method;
  }
  static int
  __Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      if (value == NULL) {
          PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
          return -1;
      }
      if (unlikely(value != Py_None && !PyCallable_Check(value))) {
          PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
          return -1;
      }
      if (value != Py_None) {
          __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
          __Pyx_BEGIN_CRITICAL_SECTION(op_in);
          Py_CLEAR(op->func_annotations);
          __Pyx_END_CRITICAL_SECTION();
      }
      return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
  }
  static PyObject *
  __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
      int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
      if (is_coroutine) {
          PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
          fromlist = PyList_New(1);
          if (unlikely(!fromlist)) return NULL;
          Py_INCREF(marker);
  #if CYTHON_ASSUME_SAFE_MACROS
          PyList_SET_ITEM(fromlist, 0, marker);
  #else
          if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
              Py_DECREF(fromlist);
              return NULL;
          }
  #endif
          module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
          Py_DECREF(fromlist);
          if (unlikely(!module)) goto ignore;
          is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
          Py_DECREF(module);
          if (likely(is_coroutine_value)) {
              return is_coroutine_value;
          }
  ignore:
          PyErr_Clear();
      }
      return __Pyx_PyBool_FromLong(is_coroutine);
  }
  static PyObject *
  __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
      PyObject *result;
      CYTHON_UNUSED_VAR(context);
      if (op->func_is_coroutine) {
          return __Pyx_NewRef(op->func_is_coroutine);
      }
      result = __Pyx_CyFunction_get_is_coroutine_value(op);
      if (unlikely(!result))
          return NULL;
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      if (op->func_is_coroutine) {
          Py_DECREF(result);
          result = __Pyx_NewRef(op->func_is_coroutine);
      } else {
          op->func_is_coroutine = __Pyx_NewRef(result);
      }
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
      if (!py_name) return;
      PyErr_Format(PyExc_TypeError,
          "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
          py_name, message, size);
      Py_DECREF(py_name);
  #else
      const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
      PyErr_Format(PyExc_TypeError,
          "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
          name, message, size);
  #endif
  }
  static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
      if (!py_name) return;
      PyErr_Format(PyExc_TypeError,
          "%.200S() %s",
          py_name, message);
      Py_DECREF(py_name);
  #else
      const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
      PyErr_Format(PyExc_TypeError,
          "%.200s() %s",
          name, message);
  #endif
  }
  #if CYTHON_COMPILING_IN_LIMITED_API
  static PyObject *
  __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
      CYTHON_UNUSED_VAR(context);
      return PyObject_GetAttrString(op->func, "__module__");
  }
  static int
  __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      return PyObject_SetAttrString(op->func, "__module__", value);
  }
  #endif
  static PyGetSetDef __pyx_CyFunction_getsets[] = {
      {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
      {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
      {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
      {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
      {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
      {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
  #else
      {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
      {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
  #endif
      {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
      {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
      {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
      {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
      {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
      {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
      {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
      {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
      {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
      {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
      {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
      {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
  #if CYTHON_COMPILING_IN_LIMITED_API
      {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
  #endif
      {0, 0, 0, 0, 0}
  };
  static PyMemberDef __pyx_CyFunction_members[] = {
  #if !CYTHON_COMPILING_IN_LIMITED_API
      {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
  #endif
  #if CYTHON_METH_FASTCALL
  #if CYTHON_COMPILING_IN_LIMITED_API
      {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
  #else
      {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
      {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
  #else
      {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
  #endif
  #endif
      {0, 0, 0,  0, 0}
  };
  static PyObject *
  __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
  {
      PyObject *result = NULL;
      CYTHON_UNUSED_VAR(args);
      __Pyx_BEGIN_CRITICAL_SECTION(m);
      Py_INCREF(m->func_qualname);
      result = m->func_qualname;
      __Pyx_END_CRITICAL_SECTION();
      return result;
  }
  static PyMethodDef __pyx_CyFunction_methods[] = {
      {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
      {0, 0, 0, 0}
  };
  #if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  #else
  #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
  #endif
  static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                         PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  #if !CYTHON_COMPILING_IN_LIMITED_API
      PyCFunctionObject *cf = (PyCFunctionObject*) op;
  #endif
      if (unlikely(op == NULL))
          return NULL;
  #if CYTHON_COMPILING_IN_LIMITED_API
      op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
      if (unlikely(!op->func)) return NULL;
  #endif
      op->flags = flags;
      __Pyx_CyFunction_weakreflist(op) = NULL;
  #if !CYTHON_COMPILING_IN_LIMITED_API
      cf->m_ml = ml;
      cf->m_self = (PyObject *) op;
  #endif
      Py_XINCREF(closure);
      op->func_closure = closure;
  #if !CYTHON_COMPILING_IN_LIMITED_API
      Py_XINCREF(module);
      cf->m_module = module;
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      op->func_dict = NULL;
  #endif
      op->func_name = NULL;
      Py_INCREF(qualname);
      op->func_qualname = qualname;
      op->func_doc = NULL;
  #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
      op->func_classobj = NULL;
  #else
      ((PyCMethodObject*)op)->mm_class = NULL;
  #endif
      op->func_globals = globals;
      Py_INCREF(op->func_globals);
      Py_XINCREF(code);
      op->func_code = code;
      op->defaults = NULL;
      op->defaults_tuple = NULL;
      op->defaults_kwdict = NULL;
      op->defaults_getter = NULL;
      op->func_annotations = NULL;
      op->func_is_coroutine = NULL;
  #if CYTHON_METH_FASTCALL
      switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
      case METH_NOARGS:
          __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
          break;
      case METH_O:
          __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
          break;
      case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
          __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
          break;
      case METH_FASTCALL | METH_KEYWORDS:
          __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
          break;
      case METH_VARARGS | METH_KEYWORDS:
          __Pyx_CyFunction_func_vectorcall(op) = NULL;
          break;
      default:
          PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
          Py_DECREF(op);
          return NULL;
      }
  #endif
      return (PyObject *) op;
  }
  static int
  __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  {
      Py_CLEAR(m->func_closure);
  #if CYTHON_COMPILING_IN_LIMITED_API
      Py_CLEAR(m->func);
  #else
      Py_CLEAR(((PyCFunctionObject*)m)->m_module);
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      Py_CLEAR(m->func_dict);
  #elif PY_VERSION_HEX < 0x030d0000
      _PyObject_ClearManagedDict((PyObject*)m);
  #else
      PyObject_ClearManagedDict((PyObject*)m);
  #endif
      Py_CLEAR(m->func_name);
      Py_CLEAR(m->func_qualname);
      Py_CLEAR(m->func_doc);
      Py_CLEAR(m->func_globals);
      Py_CLEAR(m->func_code);
  #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
      Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
  #else
      {
          PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
          ((PyCMethodObject *) (m))->mm_class = NULL;
          Py_XDECREF(cls);
      }
  #endif
      Py_CLEAR(m->defaults_tuple);
      Py_CLEAR(m->defaults_kwdict);
      Py_CLEAR(m->func_annotations);
      Py_CLEAR(m->func_is_coroutine);
      Py_CLEAR(m->defaults);
      return 0;
  }
  static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  {
      if (__Pyx_CyFunction_weakreflist(m) != NULL)
          PyObject_ClearWeakRefs((PyObject *) m);
      __Pyx_CyFunction_clear(m);
      __Pyx_PyHeapTypeObject_GC_Del(m);
  }
  static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  {
      PyObject_GC_UnTrack(m);
      __Pyx__CyFunction_dealloc(m);
  }
  static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  {
      {
          int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
          if (e) return e;
      }
      Py_VISIT(m->func_closure);
  #if CYTHON_COMPILING_IN_LIMITED_API
      Py_VISIT(m->func);
  #else
      Py_VISIT(((PyCFunctionObject*)m)->m_module);
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      Py_VISIT(m->func_dict);
  #else
      {
          int e =
  #if PY_VERSION_HEX < 0x030d0000
              _PyObject_VisitManagedDict
  #else
              PyObject_VisitManagedDict
  #endif
                  ((PyObject*)m, visit, arg);
          if (e != 0) return e;
      }
  #endif
      __Pyx_VISIT_CONST(m->func_name);
      __Pyx_VISIT_CONST(m->func_qualname);
      Py_VISIT(m->func_doc);
      Py_VISIT(m->func_globals);
      __Pyx_VISIT_CONST(m->func_code);
      Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
      Py_VISIT(m->defaults_tuple);
      Py_VISIT(m->defaults_kwdict);
      Py_VISIT(m->func_annotations);
      Py_VISIT(m->func_is_coroutine);
      Py_VISIT(m->defaults);
      return 0;
  }
  static PyObject*
  __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  {
      PyObject *repr;
      __Pyx_BEGIN_CRITICAL_SECTION(op);
      repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                  op->func_qualname, (void *)op);
      __Pyx_END_CRITICAL_SECTION();
      return repr;
  }
  static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
      PyCFunction meth;
      int flags;
      meth = PyCFunction_GetFunction(f);
      if (unlikely(!meth)) return NULL;
      flags = PyCFunction_GetFlags(f);
      if (unlikely(flags < 0)) return NULL;
  #else
      PyCFunctionObject* f = (PyCFunctionObject*)func;
      PyCFunction meth = f->m_ml->ml_meth;
      int flags = f->m_ml->ml_flags;
  #endif
      Py_ssize_t size;
      switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
      case METH_VARARGS:
          if (likely(kw == NULL || PyDict_Size(kw) == 0))
              return (*meth)(self, arg);
          break;
      case METH_VARARGS | METH_KEYWORDS:
          return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
      case METH_NOARGS:
          if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  #if CYTHON_ASSUME_SAFE_SIZE
              size = PyTuple_GET_SIZE(arg);
  #else
              size = PyTuple_Size(arg);
              if (unlikely(size < 0)) return NULL;
  #endif
              if (likely(size == 0))
                  return (*meth)(self, NULL);
              __Pyx_CyFunction_raise_argument_count_error(
                  (__pyx_CyFunctionObject*)func,
                  "takes no arguments", size);
              return NULL;
          }
          break;
      case METH_O:
          if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  #if CYTHON_ASSUME_SAFE_SIZE
              size = PyTuple_GET_SIZE(arg);
  #else
              size = PyTuple_Size(arg);
              if (unlikely(size < 0)) return NULL;
  #endif
              if (likely(size == 1)) {
                  PyObject *result, *arg0;
                  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                  arg0 = PyTuple_GET_ITEM(arg, 0);
                  #else
                  arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                  #endif
                  result = (*meth)(self, arg0);
                  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                  Py_DECREF(arg0);
                  #endif
                  return result;
              }
              __Pyx_CyFunction_raise_argument_count_error(
                  (__pyx_CyFunctionObject*)func,
                  "takes exactly one argument", size);
              return NULL;
          }
          break;
      default:
          PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
          return NULL;
      }
      __Pyx_CyFunction_raise_type_error(
          (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
      return NULL;
  }
  static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
      PyObject *self, *result;
  #if CYTHON_COMPILING_IN_LIMITED_API
      self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
      if (unlikely(!self) && PyErr_Occurred()) return NULL;
  #else
      self = ((PyCFunctionObject*)func)->m_self;
  #endif
      result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
      return result;
  }
  static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
      PyObject *result;
      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
       __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
      if (vc) {
  #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
          return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
  #else
          (void) &__Pyx_PyVectorcall_FastCallDict;
          return PyVectorcall_Call(func, args, kw);
  #endif
      }
  #endif
      if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
          Py_ssize_t argc;
          PyObject *new_args;
          PyObject *self;
  #if CYTHON_ASSUME_SAFE_SIZE
          argc = PyTuple_GET_SIZE(args);
  #else
          argc = PyTuple_Size(args);
          if (unlikely(argc < 0)) return NULL;
  #endif
          new_args = PyTuple_GetSlice(args, 1, argc);
          if (unlikely(!new_args))
              return NULL;
          self = PyTuple_GetItem(args, 0);
          if (unlikely(!self)) {
              Py_DECREF(new_args);
              PyErr_Format(PyExc_TypeError,
                           "unbound method %.200S() needs an argument",
                           cyfunc->func_qualname);
              return NULL;
          }
          result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
          Py_DECREF(new_args);
      } else {
          result = __Pyx_CyFunction_Call(func, args, kw);
      }
      return result;
  }
  #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
  {
      int ret = 0;
      if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
          if (unlikely(nargs < 1)) {
              __Pyx_CyFunction_raise_type_error(
                  cyfunc, "needs an argument");
              return -1;
          }
          ret = 1;
      }
      if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
          __Pyx_CyFunction_raise_type_error(
              cyfunc, "takes no keyword arguments");
          return -1;
      }
      return ret;
  }
  static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  {
      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      PyObject *self;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
      if (unlikely(!meth)) return NULL;
  #else
      PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  #endif
      switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
      case 1:
          self = args[0];
          args += 1;
          nargs -= 1;
          break;
      case 0:
  #if CYTHON_COMPILING_IN_LIMITED_API
          self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
          if (unlikely(!self) && PyErr_Occurred()) return NULL;
  #else
          self = ((PyCFunctionObject*)cyfunc)->m_self;
  #endif
          break;
      default:
          return NULL;
      }
      if (unlikely(nargs != 0)) {
          __Pyx_CyFunction_raise_argument_count_error(
              cyfunc, "takes no arguments", nargs);
          return NULL;
      }
      return meth(self, NULL);
  }
  static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  {
      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      PyObject *self;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
      if (unlikely(!meth)) return NULL;
  #else
      PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  #endif
      switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
      case 1:
          self = args[0];
          args += 1;
          nargs -= 1;
          break;
      case 0:
  #if CYTHON_COMPILING_IN_LIMITED_API
          self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
          if (unlikely(!self) && PyErr_Occurred()) return NULL;
  #else
          self = ((PyCFunctionObject*)cyfunc)->m_self;
  #endif
          break;
      default:
          return NULL;
      }
      if (unlikely(nargs != 1)) {
          __Pyx_CyFunction_raise_argument_count_error(
              cyfunc, "takes exactly one argument", nargs);
          return NULL;
      }
      return meth(self, args[0]);
  }
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  {
      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      PyObject *self;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
      if (unlikely(!meth)) return NULL;
  #else
      PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  #endif
      switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
      case 1:
          self = args[0];
          args += 1;
          nargs -= 1;
          break;
      case 0:
  #if CYTHON_COMPILING_IN_LIMITED_API
          self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
          if (unlikely(!self) && PyErr_Occurred()) return NULL;
  #else
          self = ((PyCFunctionObject*)cyfunc)->m_self;
  #endif
          break;
      default:
          return NULL;
      }
      return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
  }
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  {
      __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
      PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      PyObject *self;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
      if (unlikely(!meth)) return NULL;
  #else
      PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  #endif
      switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
      case 1:
          self = args[0];
          args += 1;
          nargs -= 1;
          break;
      case 0:
  #if CYTHON_COMPILING_IN_LIMITED_API
          self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
          if (unlikely(!self) && PyErr_Occurred()) return NULL;
  #else
          self = ((PyCFunctionObject*)cyfunc)->m_self;
  #endif
          break;
      default:
          return NULL;
      }
      #if PY_VERSION_HEX < 0x030e00A6
      size_t nargs_value = (size_t) nargs;
      #else
      Py_ssize_t nargs_value = nargs;
      #endif
      return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
  }
  #endif
  static PyType_Slot __pyx_CyFunctionType_slots[] = {
      {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
      {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
      {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
      {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
      {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
      {Py_tp_methods, (void *)__pyx_CyFunction_methods},
      {Py_tp_members, (void *)__pyx_CyFunction_members},
      {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
      {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
      {0, 0},
  };
  static PyType_Spec __pyx_CyFunctionType_spec = {
      __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
      sizeof(__pyx_CyFunctionObject),
      0,
  #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
      Py_TPFLAGS_METHOD_DESCRIPTOR |
  #endif
  #if CYTHON_METH_FASTCALL
  #if defined(Py_TPFLAGS_HAVE_VECTORCALL)
      Py_TPFLAGS_HAVE_VECTORCALL |
  #elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
      _Py_TPFLAGS_HAVE_VECTORCALL |
  #endif
  #endif // CYTHON_METH_FASTCALL
  #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
      Py_TPFLAGS_MANAGED_DICT |
  #endif
      Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
      __pyx_CyFunctionType_slots
  };
  static int __pyx_CyFunction_init(PyObject *module) {
      __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
      mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
          mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
      if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
          return -1;
      }
      return 0;
  }
  static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
      __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
      m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
      if (unlikely(!m->defaults))
          return NULL;
      return m->defaults;
  }
  static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
      __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
      m->defaults_tuple = tuple;
      Py_INCREF(tuple);
  }
  static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
      __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
      m->defaults_kwdict = dict;
      Py_INCREF(dict);
  }
  static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
      __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
      m->func_annotations = dict;
      Py_INCREF(dict);
  }
  
/* CythonFunction */
  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                        PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
      PyObject *op = __Pyx_CyFunction_Init(
          PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
          ml, flags, qualname, closure, module, globals, code
      );
      if (likely(op)) {
          PyObject_GC_Track(op);
      }
      return op;
  }
  
/* AsyncIter */
  static PyObject *__Pyx_Coroutine_GetAsyncIter_Fail(PyObject *obj) {
      __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
      PyErr_Format(PyExc_TypeError,
                   "'async for' requires an object with __aiter__ method, got " __Pyx_FMT_TYPENAME, obj_type_name);
      __Pyx_DECREF_TypeName(obj_type_name);
      return NULL;
  }
  static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *obj) {
  #ifdef __Pyx_AsyncGen_USED
      if (__Pyx_AsyncGen_CheckExact(obj)) {
          return __Pyx_NewRef(obj);
      }
  #endif
      {
          unaryfunc am_aiter = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_aiter, unaryfunc);
          if (likely(am_aiter)) {
              return (*am_aiter)(obj);
          }
      }
      return __Pyx_Coroutine_GetAsyncIter_Fail(obj);
  }
  static PyObject *__Pyx_Coroutine_AsyncIterNext_Fail(PyObject *obj) {
      __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
      PyErr_Format(PyExc_TypeError,
          "'async for' requires an object with __anext__ method, got " __Pyx_FMT_TYPENAME, obj_type_name);
      __Pyx_DECREF_TypeName(obj_type_name);
      return NULL;
  }
  static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *obj) {
  #ifdef __Pyx_AsyncGen_USED
      if (__Pyx_AsyncGen_CheckExact(obj)) {
          return __Pyx_async_gen_anext(obj);
      }
  #endif
      {
          unaryfunc am_anext = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_anext, unaryfunc);
          if (likely(am_anext)) {
              return (*am_anext)(obj);
          }
      }
      return __Pyx_Coroutine_AsyncIterNext_Fail(obj);
  }
  
/* pybytes_as_double (used by pynumber_float) */
  static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
      PyObject *float_value = PyFloat_FromString(obj);
      if (likely(float_value)) {
          double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
          Py_DECREF(float_value);
          return value;
      }
      return (double)-1;
  }
  static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
      int last_was_punctuation = 1;
      int parse_error_found = 0;
      Py_ssize_t i;
      for (i=0; i < length; i++) {
          char chr = start[i];
          int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
          *buffer = chr;
          buffer += (chr != '_');
          parse_error_found |= last_was_punctuation & is_punctuation;
          last_was_punctuation = is_punctuation;
      }
      parse_error_found |= last_was_punctuation;
      *buffer = '\0';
      return unlikely(parse_error_found) ? NULL : buffer;
  }
  static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
      int matches = 1;
      char sign = start[0];
      int is_signed = (sign == '+') | (sign == '-');
      start += is_signed;
      length -= is_signed;
      switch (start[0]) {
          #ifdef Py_NAN
          case 'n':
          case 'N':
              if (unlikely(length != 3)) goto parse_failure;
              matches &= (start[1] == 'a' || start[1] == 'A');
              matches &= (start[2] == 'n' || start[2] == 'N');
              if (unlikely(!matches)) goto parse_failure;
              return (sign == '-') ? -Py_NAN : Py_NAN;
          #endif
          case 'i':
          case 'I':
              if (unlikely(length < 3)) goto parse_failure;
              matches &= (start[1] == 'n' || start[1] == 'N');
              matches &= (start[2] == 'f' || start[2] == 'F');
              if (likely(length == 3 && matches))
                  return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
              if (unlikely(length != 8)) goto parse_failure;
              matches &= (start[3] == 'i' || start[3] == 'I');
              matches &= (start[4] == 'n' || start[4] == 'N');
              matches &= (start[5] == 'i' || start[5] == 'I');
              matches &= (start[6] == 't' || start[6] == 'T');
              matches &= (start[7] == 'y' || start[7] == 'Y');
              if (unlikely(!matches)) goto parse_failure;
              return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
          case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
              break;
          default:
              goto parse_failure;
      }
      return 0.0;
  parse_failure:
      return -1.0;
  }
  static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
      return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
  }
  CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
      double value;
      Py_ssize_t i, digits;
      const char *last = start + length;
      char *end;
      while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
          start++;
      while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
          last--;
      length = last - start;
      if (unlikely(length <= 0)) goto fallback;
      value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
      if (unlikely(value == -1.0)) goto fallback;
      if (value != 0.0) return value;
      digits = 0;
      for (i=0; i < length; digits += start[i++] != '_');
      if (likely(digits == length)) {
          value = PyOS_string_to_double(start, &end, NULL);
      } else if (digits < 40) {
          char number[40];
          last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
          if (unlikely(!last)) goto fallback;
          value = PyOS_string_to_double(number, &end, NULL);
      } else {
          char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
          if (unlikely(!number)) goto fallback;
          last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
          if (unlikely(!last)) {
              PyMem_Free(number);
              goto fallback;
          }
          value = PyOS_string_to_double(number, &end, NULL);
          PyMem_Free(number);
      }
      if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
          return value;
      }
  fallback:
      return __Pyx_SlowPyString_AsDouble(obj);
  }
  
/* pynumber_float */
  static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
      double val;
      if (PyLong_CheckExact(obj)) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (likely(__Pyx_PyLong_IsCompact(obj))) {
              val = (double) __Pyx_PyLong_CompactValue(obj);
              goto no_error;
          }
  #endif
          val = PyLong_AsDouble(obj);
      } else if (PyUnicode_CheckExact(obj)) {
          val = __Pyx_PyUnicode_AsDouble(obj);
      } else if (PyBytes_CheckExact(obj)) {
          val = __Pyx_PyBytes_AsDouble(obj);
      } else if (PyByteArray_CheckExact(obj)) {
          val = __Pyx_PyByteArray_AsDouble(obj);
      } else {
          return PyNumber_Float(obj);
      }
      if (unlikely(val == -1 && PyErr_Occurred())) {
          return NULL;
      }
  #if CYTHON_USE_PYLONG_INTERNALS
  no_error:
  #endif
      return PyFloat_FromDouble(val);
  }
  
/* AllocateExtensionType */
  static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
      if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
          allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
          return alloc_func(t, 0);
      } else {
          newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
          if (!tp_new) {
              PyObject *new_str = PyUnicode_FromString("__new__");
              if (likely(new_str)) {
                  PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                  Py_DECREF(new_str);
                  return o;
              } else
                  return NULL;
          } else
      #endif
          return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
      }
  }
  
/* CallNextTpDealloc */
  static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
      PyTypeObject* type = Py_TYPE(obj);
      destructor tp_dealloc = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type)
          tp_dealloc(obj);
  }
  
/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
      PyTypeObject* type = Py_TYPE(obj);
      traverseproc tp_traverse = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_traverse)
          return tp_traverse(obj, v, a);
      return 0;
  }
  
/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
      PyTypeObject* type = Py_TYPE(obj);
      inquiry tp_clear = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_clear)
          tp_clear(obj);
  }
  
/* ValidateBasesTuple (used by PyType_Ready) */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
  static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
      Py_ssize_t i, n;
  #if CYTHON_ASSUME_SAFE_SIZE
      n = PyTuple_GET_SIZE(bases);
  #else
      n = PyTuple_Size(bases);
      if (unlikely(n < 0)) return -1;
  #endif
      for (i = 1; i < n; i++)
      {
          PyTypeObject *b;
  #if CYTHON_AVOID_BORROWED_REFS
          PyObject *b0 = PySequence_GetItem(bases, i);
          if (!b0) return -1;
  #elif CYTHON_ASSUME_SAFE_MACROS
          PyObject *b0 = PyTuple_GET_ITEM(bases, i);
  #else
          PyObject *b0 = PyTuple_GetItem(bases, i);
          if (!b0) return -1;
  #endif
          b = (PyTypeObject*) b0;
          if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
          {
              __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
              PyErr_Format(PyExc_TypeError,
                  "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
              __Pyx_DECREF_TypeName(b_name);
  #if CYTHON_AVOID_BORROWED_REFS
              Py_DECREF(b0);
  #endif
              return -1;
          }
          if (dictoffset == 0)
          {
              Py_ssize_t b_dictoffset = 0;
  #if CYTHON_USE_TYPE_SLOTS
              b_dictoffset = b->tp_dictoffset;
  #else
              PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
              if (!py_b_dictoffset) goto dictoffset_return;
              b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
              Py_DECREF(py_b_dictoffset);
              if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
  #endif
              if (b_dictoffset) {
                  {
                      __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                      PyErr_Format(PyExc_TypeError,
                          "extension type '%.200s' has no __dict__ slot, "
                          "but base type '" __Pyx_FMT_TYPENAME "' has: "
                          "either add 'cdef dict __dict__' to the extension type "
                          "or add '__slots__ = [...]' to the base type",
                          type_name, b_name);
                      __Pyx_DECREF_TypeName(b_name);
                  }
  #if !CYTHON_USE_TYPE_SLOTS
                dictoffset_return:
  #endif
  #if CYTHON_AVOID_BORROWED_REFS
                  Py_DECREF(b0);
  #endif
                  return -1;
              }
          }
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(b0);
  #endif
      }
      return 0;
  }
  #endif
  
/* PyType_Ready */
  CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
      while (t) {
          PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
          if (bases) {
              return 1;
          }
          t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
      }
      return 0;
  }
  static int __Pyx_PyType_Ready(PyTypeObject *t) {
  #if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
      (void)__Pyx_PyObject_CallMethod0;
  #if CYTHON_USE_TYPE_SPECS
      (void)__Pyx_validate_bases_tuple;
  #endif
      return PyType_Ready(t);
  #else
      int r;
      if (!__Pyx_PyType_HasMultipleInheritance(t)) {
          return PyType_Ready(t);
      }
      PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
      if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
          return -1;
  #if !defined(PYSTON_MAJOR_VERSION)
      {
          int gc_was_enabled;
      #if PY_VERSION_HEX >= 0x030A00b1
          gc_was_enabled = PyGC_Disable();
          (void)__Pyx_PyObject_CallMethod0;
      #else
          PyObject *ret, *py_status;
          PyObject *gc = NULL;
          #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                  !CYTHON_COMPILING_IN_GRAAL
          gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
          #endif
          if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
          if (unlikely(!gc)) return -1;
          py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
          if (unlikely(!py_status)) {
              Py_DECREF(gc);
              return -1;
          }
          gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
          Py_DECREF(py_status);
          if (gc_was_enabled > 0) {
              ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
              if (unlikely(!ret)) {
                  Py_DECREF(gc);
                  return -1;
              }
              Py_DECREF(ret);
          } else if (unlikely(gc_was_enabled == -1)) {
              Py_DECREF(gc);
              return -1;
          }
      #endif
          t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
  #if PY_VERSION_HEX >= 0x030A0000
          t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
  #endif
  #else
          (void)__Pyx_PyObject_CallMethod0;
  #endif
      r = PyType_Ready(t);
  #if !defined(PYSTON_MAJOR_VERSION)
          t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
      #if PY_VERSION_HEX >= 0x030A00b1
          if (gc_was_enabled)
              PyGC_Enable();
      #else
          if (gc_was_enabled) {
              PyObject *tp, *v, *tb;
              PyErr_Fetch(&tp, &v, &tb);
              ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
              if (likely(ret || r == -1)) {
                  Py_XDECREF(ret);
                  PyErr_Restore(tp, v, tb);
              } else {
                  Py_XDECREF(tp);
                  Py_XDECREF(v);
                  Py_XDECREF(tb);
                  r = -1;
              }
          }
          Py_DECREF(gc);
      #endif
      }
  #endif
      return r;
  #endif
  }
  
/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
      PyObject *ob = PyCapsule_New(vtable, 0, 0);
      if (unlikely(!ob))
          goto bad;
  #if CYTHON_COMPILING_IN_LIMITED_API
      if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
  #else
      if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
  #endif
          goto bad;
      Py_DECREF(ob);
      return 0;
  bad:
      Py_XDECREF(ob);
      return -1;
  }
  
/* GetVTable (used by MergeVTables) */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
      void* ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
  #else
      PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
  #endif
      if (!ob)
          goto bad;
      ptr = PyCapsule_GetPointer(ob, 0);
      if (!ptr && !PyErr_Occurred())
          PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
      Py_DECREF(ob);
      return ptr;
  bad:
      Py_XDECREF(ob);
      return NULL;
  }
  
/* MergeVTables */
  static int __Pyx_MergeVtables(PyTypeObject *type) {
      int i=0;
      Py_ssize_t size;
      void** base_vtables;
      __Pyx_TypeName tp_base_name = NULL;
      __Pyx_TypeName base_name = NULL;
      void* unknown = (void*)-1;
      PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
      int base_depth = 0;
      {
          PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
          while (base) {
              base_depth += 1;
              base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
          }
      }
      base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
      base_vtables[0] = unknown;
  #if CYTHON_COMPILING_IN_LIMITED_API
      size = PyTuple_Size(bases);
      if (size < 0) goto other_failure;
  #else
      size = PyTuple_GET_SIZE(bases);
  #endif
      for (i = 1; i < size; i++) {
          PyObject *basei;
          void* base_vtable;
  #if CYTHON_AVOID_BORROWED_REFS
          basei = PySequence_GetItem(bases, i);
          if (unlikely(!basei)) goto other_failure;
  #elif !CYTHON_ASSUME_SAFE_MACROS
          basei = PyTuple_GetItem(bases, i);
          if (unlikely(!basei)) goto other_failure;
  #else
          basei = PyTuple_GET_ITEM(bases, i);
  #endif
          base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(basei);
  #endif
          if (base_vtable != NULL) {
              int j;
              PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
              for (j = 0; j < base_depth; j++) {
                  if (base_vtables[j] == unknown) {
                      base_vtables[j] = __Pyx_GetVtable(base);
                      base_vtables[j + 1] = unknown;
                  }
                  if (base_vtables[j] == base_vtable) {
                      break;
                  } else if (base_vtables[j] == NULL) {
                      goto bad;
                  }
                  base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
              }
          }
      }
      PyErr_Clear();
      PyMem_Free(base_vtables);
      return 0;
  bad:
      {
          PyTypeObject* basei = NULL;
          PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
          tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
  #if CYTHON_AVOID_BORROWED_REFS
          basei = (PyTypeObject*)PySequence_GetItem(bases, i);
          if (unlikely(!basei)) goto really_bad;
  #elif !CYTHON_ASSUME_SAFE_MACROS
          basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
          if (unlikely(!basei)) goto really_bad;
  #else
          basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
  #endif
          base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
  #if CYTHON_AVOID_BORROWED_REFS
          Py_DECREF(basei);
  #endif
      }
      PyErr_Format(PyExc_TypeError,
          "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
  #if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  really_bad: // bad has failed!
  #endif
      __Pyx_DECREF_TypeName(tp_base_name);
      __Pyx_DECREF_TypeName(base_name);
  #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  other_failure:
  #endif
      PyMem_Free(base_vtables);
      return -1;
  }
  
/* DelItemOnTypeDict (used by SetupReduce) */
  static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
      int result;
      PyObject *tp_dict;
  #if CYTHON_COMPILING_IN_LIMITED_API
      tp_dict = __Pyx_GetTypeDict(tp);
      if (unlikely(!tp_dict)) return -1;
  #else
      tp_dict = tp->tp_dict;
  #endif
      result = PyDict_DelItem(tp_dict, k);
      if (likely(!result)) PyType_Modified(tp);
      return result;
  }
  
/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
    int ret;
    PyObject *name_attr;
    name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
    if (likely(name_attr)) {
        ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
    } else {
        ret = -1;
    }
    if (unlikely(ret < 0)) {
        PyErr_Clear();
        ret = 0;
    }
    Py_XDECREF(name_attr);
    return ret;
  }
  static int __Pyx_setup_reduce(PyObject* type_obj) {
      int ret = 0;
      PyObject *object_reduce = NULL;
      PyObject *object_getstate = NULL;
      PyObject *object_reduce_ex = NULL;
      PyObject *reduce = NULL;
      PyObject *reduce_ex = NULL;
      PyObject *reduce_cython = NULL;
      PyObject *setstate = NULL;
      PyObject *setstate_cython = NULL;
      PyObject *getstate = NULL;
  #if CYTHON_USE_PYTYPE_LOOKUP
      getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
  #else
      getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
      if (!getstate && PyErr_Occurred()) {
          goto __PYX_BAD;
      }
  #endif
      if (getstate) {
  #if CYTHON_USE_PYTYPE_LOOKUP
          object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
  #else
          object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
          if (!object_getstate && PyErr_Occurred()) {
              goto __PYX_BAD;
          }
  #endif
          if (object_getstate != getstate) {
              goto __PYX_GOOD;
          }
      }
  #if CYTHON_USE_PYTYPE_LOOKUP
      object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  #else
      object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  #endif
      reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
      if (reduce_ex == object_reduce_ex) {
  #if CYTHON_USE_PYTYPE_LOOKUP
          object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
  #else
          object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
  #endif
          reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
          if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
              reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
              if (likely(reduce_cython)) {
                  ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                  ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
              } else if (reduce == object_reduce || PyErr_Occurred()) {
                  goto __PYX_BAD;
              }
              setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
              if (!setstate) PyErr_Clear();
              if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                  if (likely(setstate_cython)) {
                      ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                      ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                  } else if (!setstate || PyErr_Occurred()) {
                      goto __PYX_BAD;
                  }
              }
              PyType_Modified((PyTypeObject*)type_obj);
          }
      }
      goto __PYX_GOOD;
  __PYX_BAD:
      if (!PyErr_Occurred()) {
          __Pyx_TypeName type_obj_name =
              __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
          PyErr_Format(PyExc_RuntimeError,
              "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
          __Pyx_DECREF_TypeName(type_obj_name);
      }
      ret = -1;
  __PYX_GOOD:
  #if !CYTHON_USE_PYTYPE_LOOKUP
      Py_XDECREF(object_reduce);
      Py_XDECREF(object_reduce_ex);
      Py_XDECREF(object_getstate);
      Py_XDECREF(getstate);
  #endif
      Py_XDECREF(reduce);
      Py_XDECREF(reduce_ex);
      Py_XDECREF(reduce_cython);
      Py_XDECREF(setstate);
      Py_XDECREF(setstate_cython);
      return ret;
  }
  
/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_2_8
  #define __PYX_HAVE_RT_ImportType_3_2_8
  static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject *module, const char *module_name, const char *class_name,
      size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size)
  {
      PyObject *result = 0;
      Py_ssize_t basicsize;
      Py_ssize_t itemsize;
  #if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
      PyObject *py_basicsize;
      PyObject *py_itemsize;
  #endif
      result = PyObject_GetAttrString(module, class_name);
      if (!result)
          goto bad;
      if (!PyType_Check(result)) {
          PyErr_Format(PyExc_TypeError,
              "%.200s.%.200s is not a type object",
              module_name, class_name);
          goto bad;
      }
  #if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
      basicsize = ((PyTypeObject *)result)->tp_basicsize;
      itemsize = ((PyTypeObject *)result)->tp_itemsize;
  #else
      if (size == 0) {
          return (PyTypeObject *)result;
      }
      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;
      py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
      if (!py_itemsize)
          goto bad;
      itemsize = PyLong_AsSsize_t(py_itemsize);
      Py_DECREF(py_itemsize);
      py_itemsize = 0;
      if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
          goto bad;
  #endif
      if (itemsize) {
          if (size % alignment) {
              alignment = size % alignment;
          }
          if (itemsize < (Py_ssize_t)alignment)
              itemsize = (Py_ssize_t)alignment;
      }
      if ((size_t)(basicsize + itemsize) < size) {
          PyErr_Format(PyExc_ValueError,
              "%.200s.%.200s size changed, may indicate binary incompatibility. "
              "Expected %zd from C header, got %zd from PyObject",
              module_name, class_name, size, basicsize+itemsize);
          goto bad;
      }
      if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_8 &&
              ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
          PyErr_Format(PyExc_ValueError,
              "%.200s.%.200s size changed, may indicate binary incompatibility. "
              "Expected %zd from C header, got %zd-%zd from PyObject",
              module_name, class_name, size, basicsize, basicsize+itemsize);
          goto bad;
      }
      else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_8 && (size_t)basicsize > size) {
          if (PyErr_WarnFormat(NULL, 0,
                  "%.200s.%.200s size changed, may indicate binary incompatibility. "
                  "Expected %zd from C header, got %zd from PyObject",
                  module_name, class_name, size, basicsize) < 0) {
              goto bad;
          }
      }
      return (PyTypeObject *)result;
  bad:
      Py_XDECREF(result);
      return NULL;
  }
  #endif
  
/* PxdImportShared (used by FunctionImport) */
  #ifndef __PYX_HAVE_RT_ImportFromPxd_3_2_8
  #define __PYX_HAVE_RT_ImportFromPxd_3_2_8
  static int __Pyx_ImportFromPxd_3_2_8(PyObject *module, const char *name, void **p, const char *sig, const char *what) {
      PyObject *d = 0;
      PyObject *cobj = 0;
      d = PyObject_GetAttrString(module, "__pyx_capi__");
      if (!d)
          goto bad;
  #if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
      PyDict_GetItemStringRef(d, name, &cobj);
  #else
      cobj = PyDict_GetItemString(d, name);
      Py_XINCREF(cobj);
  #endif
      if (!cobj) {
          PyErr_Format(PyExc_ImportError,
              "%.200s does not export expected C %.8s %.200s",
                  PyModule_GetName(module), what, name);
          goto bad;
      }
      if (!PyCapsule_IsValid(cobj, sig)) {
          PyErr_Format(PyExc_TypeError,
              "C %.8s %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
               what, PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
          goto bad;
      }
      *p = PyCapsule_GetPointer(cobj, sig);
      if (!(*p))
          goto bad;
      Py_DECREF(d);
      Py_DECREF(cobj);
      return 0;
  bad:
      Py_XDECREF(d);
      Py_XDECREF(cobj);
      return -1;
  }
  #endif
  
/* FunctionImport */
  #ifndef __PYX_HAVE_RT_ImportFunction_3_2_8
  #define __PYX_HAVE_RT_ImportFunction_3_2_8
  static int __Pyx_ImportFunction_3_2_8(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
      union {
          void (*fp)(void);
          void *p;
      } tmp;
      int result = __Pyx_ImportFromPxd_3_2_8(module, funcname, &tmp.p, sig, "function");
      if (result == 0) {
          *f = tmp.fp;
      }
      return result;
  }
  #endif
  
/* ImportFrom */
  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
      PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
      if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
          const char* module_name_str = 0;
          PyObject* module_name = 0;
          PyObject* module_dot = 0;
          PyObject* full_name = 0;
          PyErr_Clear();
          module_name_str = PyModule_GetName(module);
          if (unlikely(!module_name_str)) { goto modbad; }
          module_name = PyUnicode_FromString(module_name_str);
          if (unlikely(!module_name)) { goto modbad; }
          module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__16);
          if (unlikely(!module_dot)) { goto modbad; }
          full_name = PyUnicode_Concat(module_dot, name);
          if (unlikely(!full_name)) { goto modbad; }
          #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                  CYTHON_COMPILING_IN_GRAAL
          {
              PyObject *modules = PyImport_GetModuleDict();
              if (unlikely(!modules))
                  goto modbad;
              value = PyObject_GetItem(modules, full_name);
          }
          #else
          value = PyImport_GetModule(full_name);
          #endif
        modbad:
          Py_XDECREF(full_name);
          Py_XDECREF(module_dot);
          Py_XDECREF(module_name);
      }
      if (unlikely(!value)) {
          PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
      }
      return value;
  }
  
/* ListPack */
  static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
      va_list va;
      PyObject *l = PyList_New(n);
      va_start(va, n);
      if (unlikely(!l)) goto end;
      for (Py_ssize_t i=0; i<n; ++i) {
          PyObject *arg = va_arg(va, PyObject*);
          Py_INCREF(arg);
          if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
              Py_CLEAR(l);
              goto end;
          }
      }
      end:
      va_end(va);
      return l;
  }
  
/* CalculateMetaclass (used by Py3ClassCreate) */
  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
      Py_ssize_t i, nbases;
  #if CYTHON_ASSUME_SAFE_SIZE
      nbases = PyTuple_GET_SIZE(bases);
  #else
      nbases = PyTuple_Size(bases);
      if (nbases < 0) return NULL;
  #endif
      for (i=0; i < nbases; i++) {
          PyTypeObject *tmptype;
  #if CYTHON_ASSUME_SAFE_MACROS
          PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  #else
          PyObject *tmp = PyTuple_GetItem(bases, i);
          if (!tmp) return NULL;
  #endif
          tmptype = Py_TYPE(tmp);
          if (!metaclass) {
              metaclass = tmptype;
              continue;
          }
          if (PyType_IsSubtype(metaclass, tmptype))
              continue;
          if (PyType_IsSubtype(tmptype, metaclass)) {
              metaclass = tmptype;
              continue;
          }
          PyErr_SetString(PyExc_TypeError,
                          "metaclass conflict: "
                          "the metaclass of a derived class "
                          "must be a (non-strict) subclass "
                          "of the metaclasses of all its bases");
          return NULL;
      }
      if (!metaclass) {
          metaclass = &PyType_Type;
      }
      Py_INCREF((PyObject*) metaclass);
      return (PyObject*) metaclass;
  }
  
/* Py3ClassCreate */
  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                             PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
      PyObject *ns;
      if (metaclass) {
          PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare_2);
          if (prep) {
              PyObject *pargs[3] = {NULL, name, bases};
              ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
              Py_DECREF(prep);
          } else {
              if (unlikely(PyErr_Occurred()))
                  return NULL;
              ns = PyDict_New();
          }
      } else {
          ns = PyDict_New();
      }
      if (unlikely(!ns))
          return NULL;
      if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
      if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
      if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
      return ns;
  bad:
      Py_DECREF(ns);
      return NULL;
  }
  static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                        PyObject *dict, PyObject *mkw,
                                        int calculate_metaclass, int allow_py2_metaclass) {
      PyObject *result;
      PyObject *owned_metaclass = NULL;
      PyObject *margs[4] = {NULL, name, bases, dict};
      if (allow_py2_metaclass) {
          owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
          if (owned_metaclass) {
              metaclass = owned_metaclass;
          } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
              PyErr_Clear();
          } else {
              return NULL;
          }
      }
      if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
          metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
          Py_XDECREF(owned_metaclass);
          if (unlikely(!metaclass))
              return NULL;
          owned_metaclass = metaclass;
      }
      result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
      Py_XDECREF(owned_metaclass);
      return result;
  }
  
/* Py3UpdateBases */
  static PyObject*
  __Pyx_PEP560_update_bases(PyObject *bases)
  {
      Py_ssize_t i, j, size_bases;
      PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
  #if CYTHON_ASSUME_SAFE_SIZE
      size_bases = PyTuple_GET_SIZE(bases);
  #else
      size_bases = PyTuple_Size(bases);
      if (size_bases < 0) return NULL;
  #endif
      for (i = 0; i < size_bases; i++) {
  #if CYTHON_AVOID_BORROWED_REFS
          Py_CLEAR(base);
  #endif
  #if CYTHON_ASSUME_SAFE_MACROS
          base = PyTuple_GET_ITEM(bases, i);
  #else
          base = PyTuple_GetItem(bases, i);
          if (!base) goto error;
  #endif
  #if CYTHON_AVOID_BORROWED_REFS
          Py_INCREF(base);
  #endif
          if (PyType_Check(base)) {
              if (new_bases) {
                  if (PyList_Append(new_bases, base) < 0) {
                      goto error;
                  }
              }
              continue;
          }
          meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
          if (!meth && PyErr_Occurred()) {
              goto error;
          }
          if (!meth) {
              if (new_bases) {
                  if (PyList_Append(new_bases, base) < 0) {
                      goto error;
                  }
              }
              continue;
          }
          new_base = __Pyx_PyObject_CallOneArg(meth, bases);
          Py_DECREF(meth);
          if (!new_base) {
              goto error;
          }
          if (!PyTuple_Check(new_base)) {
              PyErr_SetString(PyExc_TypeError,
                              "__mro_entries__ must return a tuple");
              Py_DECREF(new_base);
              goto error;
          }
          if (!new_bases) {
              if (!(new_bases = PyList_New(i))) {
                  goto error;
              }
              for (j = 0; j < i; j++) {
                  PyObject *base_from_list;
  #if CYTHON_ASSUME_SAFE_MACROS
                  base_from_list = PyTuple_GET_ITEM(bases, j);
                  PyList_SET_ITEM(new_bases, j, base_from_list);
                  Py_INCREF(base_from_list);
  #else
                  base_from_list = PyTuple_GetItem(bases, j);
                  if (!base_from_list) goto error;
                  Py_INCREF(base_from_list);
                  if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
  #endif
              }
          }
  #if CYTHON_ASSUME_SAFE_SIZE
          j = PyList_GET_SIZE(new_bases);
  #else
          j = PyList_Size(new_bases);
          if (j < 0) goto error;
  #endif
          if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
              goto error;
          }
          Py_DECREF(new_base);
      }
      if (!new_bases) {
          Py_INCREF(bases);
          return bases;
      }
      result = PyList_AsTuple(new_bases);
      Py_DECREF(new_bases);
  #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(base);
  #endif
      return result;
  error:
      Py_XDECREF(new_bases);
  #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(base);
  #endif
      return NULL;
  }
  
/* CLineInTraceback (used by AddTraceback) */
  #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  #define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
  #elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  #define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
  #else
  PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
      PyObject **dict_ptr = _PyObject_GetDictPtr(o);
      return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
  }
  #endif
  static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
      PyObject *use_cline = NULL;
      PyObject *ptype, *pvalue, *ptraceback;
      PyObject *cython_runtime_dict;
      CYTHON_MAYBE_UNUSED_VAR(tstate);
      if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
          return c_line;
      }
      __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
      cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
      if (likely(cython_runtime_dict)) {
          __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              use_cline, cython_runtime_dict,
              __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
      }
      if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
          c_line = 0;
      }
      Py_XDECREF(use_cline);
      Py_XDECREF(cython_runtime_dict);
      __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
      return c_line;
  }
  #endif
  
/* CodeObjectCache (used by AddTraceback) */
  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
      int start = 0, mid = 0, end = count - 1;
      if (end >= 0 && code_line > entries[end].code_line) {
          return count;
      }
      while (start < end) {
          mid = start + (end - start) / 2;
          if (code_line < entries[mid].code_line) {
              end = mid;
          } else if (code_line > entries[mid].code_line) {
               start = mid + 1;
          } else {
              return mid;
          }
      }
      if (code_line <= entries[mid].code_line) {
          return mid;
      } else {
          return mid + 1;
      }
  }
  static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
      __Pyx_CachedCodeObjectType* code_object;
      int pos;
      if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
          return NULL;
      }
      pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
      if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
          return NULL;
      }
      code_object = code_cache->entries[pos].code_object;
      Py_INCREF(code_object);
      return code_object;
  }
  static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
      (void)__pyx__find_code_object;
      return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
  #else
      struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
      if (old_count < 0) {
          __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
          return NULL;
      }
  #endif
      __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
  #endif
      return result;
  #endif
  }
  static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
  {
      int pos, i;
      __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
      if (unlikely(!code_line)) {
          return;
      }
      if (unlikely(!entries)) {
          entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
          if (likely(entries)) {
              code_cache->entries = entries;
              code_cache->max_count = 64;
              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(code_cache->entries, code_cache->count, code_line);
      if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
          __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
          entries[pos].code_object = code_object;
          Py_INCREF(code_object);
          Py_DECREF(tmp);
          return;
      }
      if (code_cache->count == code_cache->max_count) {
          int new_max = code_cache->max_count + 64;
          entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
              code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
          if (unlikely(!entries)) {
              return;
          }
          code_cache->entries = entries;
          code_cache->max_count = new_max;
      }
      for (i=code_cache->count; i>pos; i--) {
          entries[i] = entries[i-1];
      }
      entries[pos].code_line = code_line;
      entries[pos].code_object = code_object;
      code_cache->count++;
      Py_INCREF(code_object);
  }
  static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
      (void)__pyx__insert_code_object;
      return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
  #else
      struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      __pyx_nonatomic_int_type expected = 0;
      if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
          return;
      }
  #endif
      __pyx__insert_code_object(code_cache, code_line, code_object);
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
  #endif
  #endif
  }
  
/* AddTraceback */
  #include "compile.h"
  #include "frameobject.h"
  #include "traceback.h"
  #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
    #ifndef Py_BUILD_CORE
      #define Py_BUILD_CORE 1
    #endif
    #include "internal/pycore_frame.h"
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                         PyObject *firstlineno, PyObject *name) {
      PyObject *replace = NULL;
      if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
      if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
      replace = PyObject_GetAttrString(code, "replace");
      if (likely(replace)) {
          PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
          Py_DECREF(replace);
          return result;
      }
      PyErr_Clear();
      return NULL;
  }
  static void __Pyx_AddTraceback(const char *funcname, int c_line,
                                 int py_line, const char *filename) {
      PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
      PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
      PyObject *exc_type, *exc_value, *exc_traceback;
      int success = 0;
      if (c_line) {
          c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
      }
      PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
      code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
      if (!code_object) {
          code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
          if (unlikely(!code_object)) goto bad;
          py_py_line = PyLong_FromLong(py_line);
          if (unlikely(!py_py_line)) goto bad;
          if (c_line) {
              py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
          } else {
              py_funcname = PyUnicode_FromString(funcname);
          }
          if (unlikely(!py_funcname)) goto bad;
          dict = PyDict_New();
          if (unlikely(!dict)) goto bad;
          {
              PyObject *old_code_object = code_object;
              code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
              Py_DECREF(old_code_object);
          }
          if (unlikely(!code_object)) goto bad;
          __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
      } else {
          dict = PyDict_New();
      }
      getframe = PySys_GetObject("_getframe");
      if (unlikely(!getframe)) goto bad;
      if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
      frame = PyEval_EvalCode(code_object, dict, dict);
      if (unlikely(!frame) || frame == Py_None) goto bad;
      success = 1;
    bad:
      PyErr_Restore(exc_type, exc_value, exc_traceback);
      Py_XDECREF(code_object);
      Py_XDECREF(py_py_line);
      Py_XDECREF(py_funcname);
      Py_XDECREF(dict);
      Py_XDECREF(replace);
      if (success) {
          PyTraceBack_Here(
              (struct _frame*)frame);
      }
      Py_XDECREF(frame);
  }
  #else
  static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
              const char *funcname, int c_line,
              int py_line, const char *filename) {
      PyCodeObject *py_code = NULL;
      PyObject *py_funcname = NULL;
      if (c_line) {
          py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
          if (!py_funcname) goto bad;
          funcname = PyUnicode_AsUTF8(py_funcname);
          if (!funcname) goto bad;
      }
      py_code = PyCode_NewEmpty(filename, funcname, py_line);
      Py_XDECREF(py_funcname);
      return py_code;
  bad:
      Py_XDECREF(py_funcname);
      return NULL;
  }
  static void __Pyx_AddTraceback(const char *funcname, int c_line,
                                 int py_line, const char *filename) {
      PyCodeObject *py_code = 0;
      PyFrameObject *py_frame = 0;
      PyThreadState *tstate = __Pyx_PyThreadState_Current;
      PyObject *ptype, *pvalue, *ptraceback;
      if (c_line) {
          c_line = __Pyx_CLineForTraceback(tstate, c_line);
      }
      py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
      if (!py_code) {
          __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
          py_code = __Pyx_CreateCodeObjectForTraceback(
              funcname, c_line, py_line, filename);
          if (!py_code) {
              /* If the code object creation fails, then we should clear the
                 fetched exception references and propagate the new exception */
              Py_XDECREF(ptype);
              Py_XDECREF(pvalue);
              Py_XDECREF(ptraceback);
              goto bad;
          }
          __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
          __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
      }
      py_frame = PyFrame_New(
          tstate,            /*PyThreadState *tstate,*/
          py_code,           /*PyCodeObject *code,*/
          __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
          0                  /*PyObject *locals*/
      );
      if (!py_frame) goto bad;
      __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
      PyTraceBack_Here(py_frame);
  bad:
      Py_XDECREF(py_code);
      Py_XDECREF(py_frame);
  }
  #endif
  
/* CheckUnpickleChecksum */
  static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      PyObject *pickle_module = PyImport_ImportModule("pickle");
      if (unlikely(!pickle_module)) return;
      PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
      Py_DECREF(pickle_module);
      if (unlikely(!pickle_error)) return;
      if (checksum2 == checksum1) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
              checksum, checksum1, members);
      } else if (checksum3 == checksum2) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, members);
      } else {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, checksum3, members);
      }
      Py_DECREF(pickle_error);
  }
  static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      int found = 0;
      found |= checksum1 == checksum;
      found |= checksum2 == checksum;
      found |= checksum3 == checksum;
      if (likely(found))
          return 0;
      __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
      return -1;
  }
  
/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
      __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
      __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
      {\
          func_type value = func_value;\
          if (sizeof(target_type) < sizeof(func_type)) {\
              if (unlikely(value != (func_type) (target_type) value)) {\
                  func_type zero = 0;\
                  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                      return (target_type) -1;\
                  if (is_unsigned && unlikely(value < zero))\
                      goto raise_neg_overflow;\
                  else\
                      goto raise_overflow;\
              }\
          }\
          return (target_type) value;\
      }
  
/* UnicodeAsUCS4 */
  static void __Pyx_PyUnicode_AsPy_UCS4_error(Py_ssize_t length) {
      if (likely(length >= 0)) {
          PyErr_Format(PyExc_ValueError,
                       "only single character unicode strings can be converted to Py_UCS4, "
                       "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
      }
  }
  static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
      Py_ssize_t length = __Pyx_PyUnicode_GET_LENGTH(x);
      if (unlikely(length != 1)) {
          __Pyx_PyUnicode_AsPy_UCS4_error(length);
          return (Py_UCS4)-1;
      }
      return __Pyx_PyUnicode_READ_CHAR(x, 0);
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int32_t(int32_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int32_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int32_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int32_t __Pyx_PyLong_As_int32_t(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          int32_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int32_t) -1;
          val = __Pyx_PyLong_As_int32_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) {
                              return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) {
                              return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) {
                              return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (int32_t) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(int32_t) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(int32_t) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
          } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int32_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int32_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int32_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int32_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (int32_t) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int32_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((int32_t) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (int32_t) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to int32_t");
      return (int32_t) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to int32_t");
      return (int32_t) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ConnectionStatus) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ResultType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ResultType) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ProtocolState(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ProtocolState) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_TransactionStatus) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(uint64_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(uint64_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          uint64_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (uint64_t) -1;
          val = __Pyx_PyLong_As_uint64_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) {
                              return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) {
                              return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) {
                              return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (uint64_t) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(uint64_t) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(uint64_t) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
          } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          uint64_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (uint64_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (uint64_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (uint64_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (uint64_t) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((uint64_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((uint64_t) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (uint64_t) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to uint64_t");
      return (uint64_t) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to uint64_t");
      return (uint64_t) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          uint32_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (uint32_t) -1;
          val = __Pyx_PyLong_As_uint32_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) {
                              return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) {
                              return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) {
                              return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (uint32_t) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(uint32_t) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(uint32_t) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
          } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          uint32_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (uint32_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (uint32_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (uint32_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (uint32_t) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((uint32_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((uint32_t) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (uint32_t) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to uint32_t");
      return (uint32_t) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to uint32_t");
      return (uint32_t) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ServerDataFormat));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_AuthenticationMessage));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          int val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int) -1;
          val = __Pyx_PyLong_As_int(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                              return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                              return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                              return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (int) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(int) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                              return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                              return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                              return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(int) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
          } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (int) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((int) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (int) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to int");
      return (int) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to int");
      return (int) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          long val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (long) -1;
          val = __Pyx_PyLong_As_long(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                              return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                              return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                              return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (long) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(long) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                              return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                              return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                              return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(long) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
          } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          long val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (long) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (long) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (long) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (long) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((long) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((long) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (long) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to long");
      return (long) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to long");
      return (long) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_7asyncpg_8protocol_8protocol_CodecType(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_CodecType));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(uint32_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(uint32_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int neg_one = (int) -1, const_zero = (int) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const long neg_one = (long) -1, const_zero = (long) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(long) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(long) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(long),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat neg_one = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1, const_zero = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) >= 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) (((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)-1)*(((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) - 1 > 4 * PyLong_SHIFT)) {
                              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) ((((((((((enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, long, PyLong_AsLong(x))
          } else if ((sizeof(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat");
      return (enum __pyx_t_7asyncpg_8protocol_8protocol_ClientExchangeFormat) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          int64_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int64_t) -1;
          val = __Pyx_PyLong_As_int64_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      if (is_unsigned) {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (unlikely(__Pyx_PyLong_IsNeg(x))) {
              goto raise_neg_overflow;
          } else if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_DigitCount(x)) {
                  case 2:
                      if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) {
                              return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) {
                              return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) {
                              return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                          }
                      }
                      break;
              }
          }
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
          if (unlikely(Py_SIZE(x) < 0)) {
              goto raise_neg_overflow;
          }
  #else
          {
              int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
              if (unlikely(result < 0))
                  return (int64_t) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(int64_t) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
          } else {
              const digit* digits = __Pyx_PyLong_Digits(x);
              assert(__Pyx_PyLong_DigitCount(x) > 1);
              switch (__Pyx_PyLong_SignedDigitCount(x)) {
                  case -2:
                      if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                              return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                              return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                              return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(int64_t) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
          } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int64_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
          int one = 1; int is_little = (int)*(unsigned char *)&one;
          unsigned char *bytes = (unsigned char *)&val;
          ret = _PyLong_AsByteArray((PyLongObject *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int64_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int64_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int64_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (int64_t) 0;
          mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
          shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
          for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int64_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((int64_t) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (int64_t) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to int64_t");
      return (int64_t) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to int64_t");
      return (int64_t) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int64_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int64_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ptrdiff_t(ptrdiff_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(ptrdiff_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(ptrdiff_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ptrdiff_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int16_t(int16_t value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(int16_t) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(int16_t) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int16_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = NULL, *order_str = NULL;
          from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
          if (!from_bytes) return NULL;
          py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* ObjectAsUCS4 */
  static void __Pyx__PyObject_AsPy_UCS4_raise_error(long ival) {
     if (ival < 0) {
         if (!PyErr_Occurred())
             PyErr_SetString(PyExc_OverflowError,
                             "cannot convert negative value to Py_UCS4");
     } else {
         PyErr_SetString(PyExc_OverflowError,
                         "value too large to convert to Py_UCS4");
     }
  }
  static Py_UCS4 __Pyx__PyObject_AsPy_UCS4(PyObject* x) {
     long ival;
     ival = __Pyx_PyLong_As_long(x);
     if (unlikely(!__Pyx_is_valid_index(ival, 1114111 + 1))) {
         __Pyx__PyObject_AsPy_UCS4_raise_error(ival);
         return (Py_UCS4)-1;
     }
     return (Py_UCS4)ival;
  }
  
/* UpdateUnpickledDict */
  static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
      if (unlikely(!state_dict)) {
          return -1;
      }
      int non_empty = PyObject_IsTrue(state_dict);
      if (non_empty == 0) {
          Py_DECREF(state_dict);
          return 0;
      } else if (unlikely(non_empty == -1)) {
          return -1;
      }
      PyObject *dict;
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = PyObject_GetAttrString(obj, "__dict__");
      #else
      dict = PyObject_GenericGetDict(obj, NULL);
      #endif
      if (unlikely(!dict)) {
          Py_DECREF(state_dict);
          return -1;
      }
      int result;
      if (likely(PyDict_CheckExact(dict))) {
          result = PyDict_Update(dict, state_dict);
      } else {
          PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
          if (likely(obj_result)) {
              Py_DECREF(obj_result);
              result = 0;
          } else {
              result = -1;
          }
      }
      Py_DECREF(state_dict);
      Py_DECREF(dict);
      return result;
  }
  static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(state_size == -1)) return -1;
      #endif
      if (state_size <= index) {
          return 0;
      }
      return __Pyx__UpdateUnpickledDict(obj, state, index);
  }
  
/* FormatTypeName */
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static __Pyx_TypeName
  __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
  {
      PyObject *module = NULL, *name = NULL, *result = NULL;
      #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
      name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_qualname);
      #else
      name = PyType_GetQualName(tp);
      #endif
      if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
      module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_module);
      if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
      if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
          result = name;
          name = NULL;
          goto done;
      }
      result = PyUnicode_FromFormat("%U.%U", module, name);
      if (unlikely(result == NULL)) goto bad;
    done:
      Py_XDECREF(name);
      Py_XDECREF(module);
      return result;
    bad:
      PyErr_Clear();
      if (name) {
          result = name;
          name = NULL;
      } else {
          result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__25);
      }
      goto done;
  }
  #endif
  
/* GetRuntimeVersion */
  #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  void __Pyx_init_runtime_version(void) {
      if (__Pyx_cached_runtime_version == 0) {
          const char* rt_version = Py_GetVersion();
          unsigned long version = 0;
          unsigned long factor = 0x01000000UL;
          unsigned int digit = 0;
          int i = 0;
          while (factor) {
              while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                  digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                  ++i;
              }
              version += factor * digit;
              if (rt_version[i] != '.')
                  break;
              digit = 0;
              factor >>= 8;
              ++i;
          }
          __Pyx_cached_runtime_version = version;
      }
  }
  #endif
  static unsigned long __Pyx_get_runtime_version(void) {
  #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
      return Py_Version & ~0xFFUL;
  #else
      return __Pyx_cached_runtime_version;
  #endif
  }
  
/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
      {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
       PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
      {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
       PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
      {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
       PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
      {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
      {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
      {0, 0, 0, 0}
  };
  static PyMemberDef __pyx_Generator_memberlist[] = {
      {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
       PyDoc_STR("object being iterated by 'yield from', or None")},
      {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
      {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
  #endif
      {0, 0, 0, 0, 0}
  };
  static PyGetSetDef __pyx_Generator_getsets[] = {
      {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
       PyDoc_STR("name of the generator"), 0},
      {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
       PyDoc_STR("qualified name of the generator"), 0},
      {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
       PyDoc_STR("Frame of the generator"), 0},
      {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
      {0, 0, 0, 0, 0}
  };
  static PyType_Slot __pyx_GeneratorType_slots[] = {
      {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
      {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
      {Py_tp_iter, (void *)PyObject_SelfIter},
      {Py_tp_iternext, (void *)__Pyx_Generator_Next},
      {Py_tp_methods, (void *)__pyx_Generator_methods},
      {Py_tp_members, (void *)__pyx_Generator_memberlist},
      {Py_tp_getset, (void *)__pyx_Generator_getsets},
      {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
  #if CYTHON_USE_TP_FINALIZE
      {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
  #endif
  #if __PYX_HAS_PY_AM_SEND == 1
      {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
  #endif
      {0, 0},
  };
  static PyType_Spec __pyx_GeneratorType_spec = {
      __PYX_TYPE_MODULE_PREFIX "generator",
      sizeof(__pyx_CoroutineObject),
      0,
  #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
      Py_TPFLAGS_MANAGED_WEAKREF |
  #endif
      Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
      __pyx_GeneratorType_slots
  };
  #if __PYX_HAS_PY_AM_SEND == 2
  static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
  #endif
  static int __pyx_Generator_init(PyObject *module) {
      __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
      mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
          mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
      if (unlikely(!mstate->__pyx_GeneratorType)) {
          return -1;
      }
  #if __PYX_HAS_PY_AM_SEND == 2
      __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
  #endif
      return 0;
  }
  static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
      PyObject *retval = NULL;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          return __Pyx_Coroutine_AlreadyRunningError(gen);
      }
      __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
      __Pyx_Coroutine_unset_is_running(gen);
      (void) result;
      assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
      assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
      return retval;
  }
  
/* CheckBinaryVersion */
  static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
      const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
      if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
          return 0;
      if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
          return 1;
      {
          char message[200];
          PyOS_snprintf(message, sizeof(message),
                        "compile time Python version %d.%d "
                        "of module '%.100s' "
                        "%s "
                        "runtime version %d.%d",
                         (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                         __Pyx_MODULE_NAME,
                         (allow_newer) ? "was newer than" : "does not match",
                         (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
         );
          return PyErr_WarnEx(NULL, message, 1);
      }
  }
  
/* NewCodeObj */
  #if CYTHON_COMPILING_IN_LIMITED_API
      static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
          PyObject *exception_table = NULL;
          PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
          #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
          PyObject *version_info;
          PyObject *py_minor_version = NULL;
          #endif
          long minor_version = 0;
          PyObject *type, *value, *traceback;
          PyErr_Fetch(&type, &value, &traceback);
          #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
          minor_version = 11;
          #else
          if (!(version_info = PySys_GetObject("version_info"))) goto end;
          if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
          minor_version = PyLong_AsLong(py_minor_version);
          Py_DECREF(py_minor_version);
          if (minor_version == -1 && PyErr_Occurred()) goto end;
          #endif
          if (!(types_module = PyImport_ImportModule("types"))) goto end;
          if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
          if (minor_version <= 7) {
              (void)p;
              result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                            c, n, v, fn, name, fline, lnos, fv, cell);
          } else if (minor_version <= 10) {
              result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                            c, n, v, fn, name, fline, lnos, fv, cell);
          } else {
              if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
              result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                            c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
          }
      end:
          Py_XDECREF(code_type);
          Py_XDECREF(exception_table);
          Py_XDECREF(types_module);
          if (type) {
              PyErr_Restore(type, value, traceback);
          }
          return result;
      }
  #elif PY_VERSION_HEX >= 0x030B0000
    static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                           PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                           PyObject *fv, PyObject *cell, PyObject* fn,
                                           PyObject *name, int fline, PyObject *lnos) {
      PyCodeObject *result;
      result =
        #if PY_VERSION_HEX >= 0x030C0000
          PyUnstable_Code_NewWithPosOnlyArgs
        #else
          PyCode_NewWithPosOnlyArgs
        #endif
          (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
      #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
      if (likely(result))
          result->_co_firsttraceable = 0;
      #endif
      return result;
    }
  #elif !CYTHON_COMPILING_IN_PYPY
    #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
            PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #else
    #define __Pyx__PyCode_New(a, p, 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
  static PyObject* __Pyx_PyCode_New(
          const __Pyx_PyCode_New_function_description descr,
          PyObject * const *varnames,
          PyObject *filename,
          PyObject *funcname,
          PyObject *line_table,
          PyObject *tuple_dedup_map
  ) {
      PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
      Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
      PyObject *varnames_tuple = PyTuple_New(var_count);
      if (unlikely(!varnames_tuple)) return NULL;
      for (Py_ssize_t i=0; i < var_count; i++) {
          Py_INCREF(varnames[i]);
          if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
      }
      #if CYTHON_COMPILING_IN_LIMITED_API
      varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
      if (!varnames_tuple_dedup) {
          if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
          varnames_tuple_dedup = varnames_tuple;
      }
      #else
      varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
      if (unlikely(!varnames_tuple_dedup)) goto done;
      #endif
      #if CYTHON_AVOID_BORROWED_REFS
      Py_INCREF(varnames_tuple_dedup);
      #endif
      if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
          Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(line_table_length == -1)) goto done;
          #endif
          Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
          code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
          if (unlikely(!code_bytes)) goto done;
          char* c_code_bytes = PyBytes_AsString(code_bytes);
          if (unlikely(!c_code_bytes)) goto done;
          memset(c_code_bytes, 0, (size_t) code_len);
      }
      code_obj = (PyObject*) __Pyx__PyCode_New(
          (int) descr.argcount,
          (int) descr.num_posonly_args,
          (int) descr.num_kwonly_args,
          (int) descr.nlocals,
          0,
          (int) descr.flags,
          code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          varnames_tuple_dedup,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          filename,
          funcname,
          (int) descr.first_line,
          (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
      );
  done:
      Py_XDECREF(code_bytes);
      #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(varnames_tuple_dedup);
      #endif
      Py_DECREF(varnames_tuple);
      return code_obj;
  }
  
/* DecompressString */
  static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
      PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
      const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
      PyObject *methodname = PyUnicode_FromString("decompress");
      if (unlikely(!methodname)) return NULL;
      #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
      if (algo == 3) {
          PyObject *fromlist = Py_BuildValue("[O]", methodname);
          if (unlikely(!fromlist)) goto bad;
          module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
          Py_DECREF(fromlist);
      } else
      #endif
          module = PyImport_ImportModule(module_name);
      if (unlikely(!module)) goto import_failed;
      decompress = PyObject_GetAttr(module, methodname);
      if (unlikely(!decompress)) goto import_failed;
      {
          #ifdef __cplusplus
              char *memview_bytes = const_cast<char*>(s);
          #else
              #if defined(__clang__)
                #pragma clang diagnostic push
                #pragma clang diagnostic ignored "-Wcast-qual"
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic push
                #pragma GCC diagnostic ignored "-Wcast-qual"
              #endif
              char *memview_bytes = (char*) s;
              #if defined(__clang__)
                #pragma clang diagnostic pop
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic pop
              #endif
          #endif
          #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
          int memview_flags = 0x100;
          #else
          int memview_flags = PyBUF_READ;
          #endif
          compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
      }
      if (unlikely(!compressed_bytes)) {
          Py_DECREF(decompress);
          goto bad;
      }
      decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
      Py_DECREF(compressed_bytes);
      Py_DECREF(decompress);
      Py_DECREF(module);
      Py_DECREF(methodname);
      return decompressed;
  import_failed:
      PyErr_Format(PyExc_ImportError,
          "Failed to import '%.20s.decompress' - cannot initialise module strings. "
          "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
          module_name, algo);
  bad:
      Py_XDECREF(module);
      Py_DECREF(methodname);
      return NULL;
  }
  
#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
}
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  else if (!PyErr_Occurred()) {
      PyErr_SetString(PyExc_TypeError,
                      "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


  /* MultiPhaseInitModuleState */
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
  #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
  #else
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
  #endif
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
  #error "Module state with PEP489 requires atomics. Currently that's one of\
   C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
  #endif
  #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #define __Pyx_ModuleStateLookup_Lock()
  #define __Pyx_ModuleStateLookup_Unlock()
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
  static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
  #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(__cplusplus) && __cplusplus >= 201103L
  #include <mutex>
  static std::mutex __Pyx_ModuleStateLookup_mutex;
  #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
  #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
  #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
  #include <threads.h>
  static mtx_t __Pyx_ModuleStateLookup_mutex;
  static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
  static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
      mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
  }
  #define __Pyx_ModuleStateLookup_Lock()\
    call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
    mtx_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(HAVE_PTHREAD_H)
  #include <pthread.h>
  static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
  #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(_WIN32)
  #include <Windows.h>  // synchapi.h on its own doesn't work
  static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
  #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #else
  #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
   Requires C standard >= C11, or C++ standard >= C++11,\
   or pthreads, or the Windows 32 API, or Python >= 3.13."
  #endif
  typedef struct {
      int64_t id;
      PyObject *module;
  } __Pyx_InterpreterIdAndModule;
  typedef struct {
      char interpreter_id_as_index;
      Py_ssize_t count;
      Py_ssize_t allocated;
      __Pyx_InterpreterIdAndModule table[1];
  } __Pyx_ModuleStateLookupData;
  #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
  #else
  static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
  #endif
  static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
          __Pyx_InterpreterIdAndModule* table,
          Py_ssize_t count,
          int64_t interpreterId) {
      __Pyx_InterpreterIdAndModule* begin = table;
      __Pyx_InterpreterIdAndModule* end = begin + count;
      if (begin->id == interpreterId) {
          return begin;
      }
      while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
          __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
          if (halfway->id == interpreterId) {
              return halfway;
          }
          if (halfway->id < interpreterId) {
              begin = halfway;
          } else {
              end = halfway;
          }
      }
      for (; begin < end; ++begin) {
          if (begin->id >= interpreterId) return begin;
      }
      return begin;
  }
  static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return NULL;
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
      {
          __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          if (likely(data)) {
              __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
              if (likely(data == new_data)) {
                  goto read_finished;
              }
          }
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          __Pyx_ModuleStateLookup_Lock();
          __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
          data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
          __Pyx_ModuleStateLookup_Unlock();
      }
    read_finished:;
  #else
      __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_InterpreterIdAndModule* found = NULL;
      if (unlikely(!data)) goto end;
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              found = data->table+interpreter_id;
          }
      } else {
          found = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
      }
    end:
      {
          PyObject *result=NULL;
          if (found && found->id == interpreter_id) {
              result = found->module;
          }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  #endif
          return result;
      }
  }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
      while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
  }
  #else
  #define __Pyx_ModuleStateLookup_wait_until_no_readers()
  #endif
  static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
      Py_ssize_t to_allocate = (*old_data)->allocated;
      while (to_allocate <= interpreter_id) {
          if (to_allocate == 0) to_allocate = 1;
          else to_allocate *= 2;
      }
      __Pyx_ModuleStateLookupData *new_data = *old_data;
      if (to_allocate != (*old_data)->allocated) {
           new_data = (__Pyx_ModuleStateLookupData *)realloc(
              *old_data,
              sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
          if (!new_data) {
              PyErr_NoMemory();
              return -1;
          }
          for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
              new_data->table[i].id = i;
              new_data->table[i].module = NULL;
          }
          new_data->allocated = to_allocate;
      }
      new_data->table[interpreter_id].module = module;
      if (new_data->count < interpreter_id+1) {
          new_data->count = interpreter_id+1;
      }
      *old_data = new_data;
      return 0;
  }
  static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
      __Pyx_InterpreterIdAndModule *read = data->table;
      __Pyx_InterpreterIdAndModule *write = data->table;
      __Pyx_InterpreterIdAndModule *end = read + data->count;
      for (; read<end; ++read) {
          if (read->module) {
              write->id = read->id;
              write->module = read->module;
              ++write;
          }
      }
      data->count = write - data->table;
      for (; write<end; ++write) {
          write->id = 0;
          write->module = NULL;
      }
      data->interpreter_id_as_index = 0;
  }
  static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      int result = 0;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_ModuleStateLookupData *new_data = old_data;
      if (!new_data) {
          new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
          if (!new_data) {
              result = -1;
              PyErr_NoMemory();
              goto end;
          }
          new_data->allocated = 1;
          new_data->interpreter_id_as_index = 1;
      }
      __Pyx_ModuleStateLookup_wait_until_no_readers();
      if (new_data->interpreter_id_as_index) {
          if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
              result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
              goto end;
          }
          __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
      }
      {
          Py_ssize_t insert_at = 0;
          {
              __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                  new_data->table, new_data->count, interpreter_id);
              assert(lower_bound);
              insert_at = lower_bound - new_data->table;
              if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                  lower_bound->module = module;
                  goto end;  // already in table, nothing more to do
              }
          }
          if (new_data->count+1 >= new_data->allocated) {
              Py_ssize_t to_allocate = (new_data->count+1)*2;
              new_data =
                  (__Pyx_ModuleStateLookupData*)realloc(
                      new_data,
                      sizeof(__Pyx_ModuleStateLookupData) +
                      (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
              if (!new_data) {
                  result = -1;
                  new_data = old_data;
                  PyErr_NoMemory();
                  goto end;
              }
              new_data->allocated = to_allocate;
          }
          ++new_data->count;
          int64_t last_id = interpreter_id;
          PyObject *last_module = module;
          for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
              int64_t current_id = new_data->table[i].id;
              new_data->table[i].id = last_id;
              last_id = current_id;
              PyObject *current_module = new_data->table[i].module;
              new_data->table[i].module = last_module;
              last_module = current_module;
          }
      }
    end:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
  #else
      __Pyx_ModuleStateLookup_data = new_data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return result;
  }
  static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
  #endif
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              data->table[interpreter_id].module = NULL;
          }
          goto done;
      }
      {
          __Pyx_ModuleStateLookup_wait_until_no_readers();
          __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
          if (!lower_bound) goto done;
          if (lower_bound->id != interpreter_id) goto done;
          __Pyx_InterpreterIdAndModule *end = data->table+data->count;
          for (;lower_bound<end-1; ++lower_bound) {
              lower_bound->id = (lower_bound+1)->id;
              lower_bound->module = (lower_bound+1)->module;
          }
      }
      --data->count;
      if (data->count == 0) {
          free(data);
          data = NULL;
      }
    done:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
  #else
      __Pyx_ModuleStateLookup_data = data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return 0;
  }
  #endif
  
/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
